Class: JobTemplateEffectiveUser

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/job_template_effective_user.rb

Instance Method Summary collapse

Instance Method Details

#compute_valueObject



14
15
16
17
18
19
20
21
22
# File 'app/models/job_template_effective_user.rb', line 14

def compute_value
  if current_user?
    User.current.
  elsif value.present?
    value
  else
    Setting[:remote_execution_effective_user]
  end
end

#set_defaultsObject



9
10
11
12
# File 'app/models/job_template_effective_user.rb', line 9

def set_defaults
  self.overridable = true if self.overridable.nil?
  self.current_user = false if self.current_user.nil?
end