Sha256: e88785917eca6f4ead5895d03d9d66e7e47aad73a28018d464a24739f97e63ed

Contents?: true

Size: 493 Bytes

Versions: 19

Compression:

Stored size: 493 Bytes

Contents

module Katello
  module Validators
    class RepoDisablementValidator < ActiveModel::Validator
      def validate(record)
        if record.redhat? && record.enabled_changed? && (!record.enabled?) && record.promoted?
          record.errors[:base] << N_("Repository cannot be disabled since it has already been promoted.")
        elsif !record.redhat? && !record.enabled?
          record.errors[:base] << N_("Custom repositories cannot be disabled.")
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
katello-3.0.2 app/lib/katello/validators/repo_disablement_validator.rb
katello-2.4.5 app/lib/katello/validators/repo_disablement_validator.rb
katello-3.1.0.rc1 app/lib/katello/validators/repo_disablement_validator.rb
katello-3.0.1 app/lib/katello/validators/repo_disablement_validator.rb
katello-2.4.4 app/lib/katello/validators/repo_disablement_validator.rb
katello-3.0.0 app/lib/katello/validators/repo_disablement_validator.rb
katello-2.4.3 app/lib/katello/validators/repo_disablement_validator.rb
katello-3.0.0.rc7 app/lib/katello/validators/repo_disablement_validator.rb
katello-3.0.0.rc5 app/lib/katello/validators/repo_disablement_validator.rb
katello-2.4.2 app/lib/katello/validators/repo_disablement_validator.rb
katello-3.0.0.rc4 app/lib/katello/validators/repo_disablement_validator.rb
katello-3.0.0.rc3 app/lib/katello/validators/repo_disablement_validator.rb
katello-3.0.0.rc2 app/lib/katello/validators/repo_disablement_validator.rb
katello-3.0.0.rc1 app/lib/katello/validators/repo_disablement_validator.rb
katello-2.4.1 app/lib/katello/validators/repo_disablement_validator.rb
katello-2.4.0 app/lib/katello/validators/repo_disablement_validator.rb
katello-2.4.0.rc3 app/lib/katello/validators/repo_disablement_validator.rb
katello-2.4.0.rc2 app/lib/katello/validators/repo_disablement_validator.rb
katello-2.4.0.rc1 app/lib/katello/validators/repo_disablement_validator.rb