Class: Katello::ContentViewDebFilterRule

Inherits:
Model
  • Object
show all
Includes:
Katello::Concerns::ContentViewFilterRuleCommon
Defined in:
app/models/katello/content_view_deb_filter_rule.rb

Instance Method Summary collapse

Methods inherited from Model

#destroy!

Instance Method Details

#ensure_unique_attributesObject



14
15
16
17
18
19
20
21
22
# File 'app/models/katello/content_view_deb_filter_rule.rb', line 14

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