Sha256: 176c7186db9ffb6a932ec8f298efb22b398651a6b51c7caae1d450eed3ddf64b

Contents?: true

Size: 876 Bytes

Versions: 52

Compression:

Stored size: 876 Bytes

Contents

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

    belongs_to :filter,
               :class_name => "Katello::ContentViewDebFilter",
               :inverse_of => :deb_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,
                               :content_view_filter_id => self.content_view_filter_id,
                               :architecture => self.architecture)
      other = other.where.not(:id => self.id) if self.id
      if other.exists?
        errors.add(:base, "This deb package filter rule already exists.")
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
katello-4.7.3 app/models/katello/content_view_deb_filter_rule.rb
katello-4.7.2 app/models/katello/content_view_deb_filter_rule.rb
katello-4.7.1 app/models/katello/content_view_deb_filter_rule.rb
katello-4.6.2.1 app/models/katello/content_view_deb_filter_rule.rb
katello-4.6.2 app/models/katello/content_view_deb_filter_rule.rb
katello-4.7.0 app/models/katello/content_view_deb_filter_rule.rb
katello-4.6.1 app/models/katello/content_view_deb_filter_rule.rb
katello-4.7.0.rc2 app/models/katello/content_view_deb_filter_rule.rb
katello-4.7.0.rc1 app/models/katello/content_view_deb_filter_rule.rb
katello-4.6.0 app/models/katello/content_view_deb_filter_rule.rb
katello-4.6.0.rc2 app/models/katello/content_view_deb_filter_rule.rb
katello-4.6.0.rc1 app/models/katello/content_view_deb_filter_rule.rb