Sha256: 2a7caa361df51aea6e991cc4b07d4a04c09d7f0273ace5014fcf4db15a388e10

Contents?: true

Size: 428 Bytes

Versions: 143

Compression:

Stored size: 428 Bytes

Contents

class JobTemplateEffectiveUser < ApplicationRecord

  belongs_to :job_template

  before_validation :set_defaults

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

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

Version data entries

143 entries across 143 versions & 1 rubygems

Version Path
foreman_remote_execution-14.1.4 app/models/job_template_effective_user.rb
foreman_remote_execution-14.1.3 app/models/job_template_effective_user.rb
foreman_remote_execution-14.1.2 app/models/job_template_effective_user.rb
foreman_remote_execution-14.1.1 app/models/job_template_effective_user.rb
foreman_remote_execution-14.1.0 app/models/job_template_effective_user.rb
foreman_remote_execution-14.0.2 app/models/job_template_effective_user.rb
foreman_remote_execution-14.0.1 app/models/job_template_effective_user.rb
foreman_remote_execution-13.2.6 app/models/job_template_effective_user.rb
foreman_remote_execution-14.0.0 app/models/job_template_effective_user.rb
foreman_remote_execution-13.2.5 app/models/job_template_effective_user.rb
foreman_remote_execution-13.2.4 app/models/job_template_effective_user.rb
foreman_remote_execution-13.2.3 app/models/job_template_effective_user.rb
foreman_remote_execution-13.2.2 app/models/job_template_effective_user.rb
foreman_remote_execution-12.0.7 app/models/job_template_effective_user.rb
foreman_remote_execution-13.2.1 app/models/job_template_effective_user.rb
foreman_remote_execution-13.2.0 app/models/job_template_effective_user.rb
foreman_remote_execution-10.1.3 app/models/job_template_effective_user.rb
foreman_remote_execution-13.0.0 app/models/job_template_effective_user.rb
foreman_remote_execution-12.0.5 app/models/job_template_effective_user.rb
foreman_remote_execution-12.0.4 app/models/job_template_effective_user.rb