minor improvement

This commit is contained in:
Hauke Klement
2015-03-10 17:15:13 +01:00
parent fee05a420b
commit 240c570698
2 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ module Admin
end
def docker_data
ExecutionEnvironment.order(:id).select(:id, :permitted_execution_time, :pool_size).map do |execution_environment|
ExecutionEnvironment.order(:id).select(:id, :pool_size).map do |execution_environment|
execution_environment.attributes.merge(quantity: DockerContainerPool.quantities[execution_environment.id])
end
end

View File

@ -19,8 +19,8 @@ class ExecutionEnvironment < ActiveRecord::Base
validates :run_command, presence: true
def set_default_values
self.permitted_execution_time ||= 60
self.pool_size ||= 0
self.permitted_execution_time ||= 60 if has_attribute?(:permitted_execution_time)
self.pool_size ||= 0 if has_attribute?(:pool_size)
end
private :set_default_values