Sha256: 6911ab639f460f2a36f2433b0808f573f0aedc06d5c0efa0dbce954edb3b3d39

Contents?: true

Size: 1004 Bytes

Versions: 111

Compression:

Stored size: 1004 Bytes

Contents

module Katello
  class ContentViewPackageFilterRule < Katello::Model
    include ::Katello::Concerns::ContentViewFilterRuleCommon

    belongs_to :filter,
               :class_name => "Katello::ContentViewPackageFilter",
               :inverse_of => :package_rules,
               :foreign_key => :content_view_filter_id

    validates :name, :presence => true
    validate :ensure_unique_attributes
    validates_with Validators::ContentViewFilterVersionValidator

    def ensure_unique_attributes
      other = self.class.where(:name => self.name,
                               :version => self.version,
                               :content_view_filter_id => self.content_view_filter_id,
                               :min_version => self.min_version,
                               :max_version => self.max_version)
      other = other.where.not(:id => self.id) if self.id
      if other.exists?
        errors.add(:base, "This package filter rule already exists.")
      end
    end
  end
end

Version data entries

111 entries across 111 versions & 1 rubygems

Version Path
katello-3.18.1 app/models/katello/content_view_package_filter_rule.rb
katello-3.18.0 app/models/katello/content_view_package_filter_rule.rb
katello-3.17.1 app/models/katello/content_view_package_filter_rule.rb
katello-3.16.2 app/models/katello/content_view_package_filter_rule.rb
katello-3.18.0.rc2.1 app/models/katello/content_view_package_filter_rule.rb
katello-3.18.0.rc2 app/models/katello/content_view_package_filter_rule.rb
katello-3.17.0 app/models/katello/content_view_package_filter_rule.rb
katello-3.18.0.rc1 app/models/katello/content_view_package_filter_rule.rb
katello-3.17.0.rc2.2 app/models/katello/content_view_package_filter_rule.rb
katello-3.17.0.rc2.1 app/models/katello/content_view_package_filter_rule.rb
katello-3.16.1.2 app/models/katello/content_view_package_filter_rule.rb
katello-3.16.1.1 app/models/katello/content_view_package_filter_rule.rb
katello-3.17.0.rc2 app/models/katello/content_view_package_filter_rule.rb
katello-3.16.1 app/models/katello/content_view_package_filter_rule.rb
katello-3.17.0.rc1 app/models/katello/content_view_package_filter_rule.rb
katello-3.16.0 app/models/katello/content_view_package_filter_rule.rb
katello-3.16.0.rc5.1 app/models/katello/content_view_package_filter_rule.rb
katello-3.16.0.rc5 app/models/katello/content_view_package_filter_rule.rb
katello-3.16.0.rc4.1 app/models/katello/content_view_package_filter_rule.rb
katello-3.15.3.1 app/models/katello/content_view_package_filter_rule.rb