Class: JobTemplateEffectiveUser

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

Instance Method Summary collapse

Instance Method Details

#compute_valueObject



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

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

#set_defaultsObject



7
8
9
10
# File 'app/models/job_template_effective_user.rb', line 7

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