Class: Katello::Validators::SelfReferenceEnvironmentValidator

Inherits:
ActiveModel::Validator
  • Object
show all
Defined in:
app/lib/katello/validators/self_reference_environment_validator.rb

Instance Method Summary collapse

Instance Method Details

#validate(record) ⇒ Object



4
5
6
# File 'app/lib/katello/validators/self_reference_environment_validator.rb', line 4

def validate(record)
  record.errors[:base] << _("Environment cannot be in its own promotion path") if record.priors.select(:id).include? record.id
end