Sha256: 9cdbe723b78bbcec462d9b84b35f77592a37ce2d6d6d2064bb1fdc339d560504

Contents?: true

Size: 292 Bytes

Versions: 248

Compression:

Stored size: 292 Bytes

Contents

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

Version data entries

248 entries across 248 versions & 1 rubygems

Version Path
katello-4.14.2 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.15.0 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.15.0.rc2 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.15.0.rc1 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.14.1 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.14.0 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.14.0.rc3 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.14.0.rc2 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.14.0.rc1.1 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.14.0.rc1 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.13.1 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.13.0 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.12.1 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.13.0.rc1 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.12.0 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.12.0.rc3 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.12.0.rc2 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.12.0.rc1 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.11.1 app/lib/katello/validators/self_reference_environment_validator.rb
katello-4.11.0 app/lib/katello/validators/self_reference_environment_validator.rb