Sha256: f54ff12e6e5d00bacb1f5df0c0a2bda13c2b0acb5fa0f1cd52718e13a46a1a76

Contents?: true

Size: 429 Bytes

Versions: 17

Compression:

Stored size: 429 Bytes

Contents

class JobTemplateEffectiveUser < ActiveRecord::Base

  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

17 entries across 17 versions & 1 rubygems

Version Path
foreman_remote_execution-1.3.7 app/models/job_template_effective_user.rb
foreman_remote_execution-1.3.6 app/models/job_template_effective_user.rb
foreman_remote_execution-1.4.1 app/models/job_template_effective_user.rb
foreman_remote_execution-1.3.5 app/models/job_template_effective_user.rb
foreman_remote_execution-1.3.4 app/models/job_template_effective_user.rb
foreman_remote_execution-1.3.3 app/models/job_template_effective_user.rb
foreman_remote_execution-1.3.2 app/models/job_template_effective_user.rb
foreman_remote_execution-1.3.1 app/models/job_template_effective_user.rb
foreman_remote_execution-1.3.0 app/models/job_template_effective_user.rb
foreman_remote_execution-1.2.2 app/models/job_template_effective_user.rb
foreman_remote_execution-1.2.1 app/models/job_template_effective_user.rb
foreman_remote_execution-1.2.0 app/models/job_template_effective_user.rb
foreman_remote_execution-1.1.1 app/models/job_template_effective_user.rb
foreman_remote_execution-1.1.0 app/models/job_template_effective_user.rb
foreman_remote_execution-0.3.2 app/models/job_template_effective_user.rb
foreman_remote_execution-0.3.1 app/models/job_template_effective_user.rb
foreman_remote_execution-0.3.0 app/models/job_template_effective_user.rb