Sha256: d2429ade2ad2389b195c7617b163e7449ee7b10471cae14acb9f13d791db5d25

Contents?: true

Size: 757 Bytes

Versions: 10

Compression:

Stored size: 757 Bytes

Contents

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

    belongs_to :filter,
               :class_name => "Katello::ContentViewDockerFilter",
               :inverse_of => :docker_rules,
               :foreign_key => :content_view_filter_id

    validates :name, :presence => true
    validate :ensure_unique_attributes

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
katello-3.5.2 app/models/katello/content_view_docker_filter_rule.rb
katello-3.6.0 app/models/katello/content_view_docker_filter_rule.rb
katello-3.6.0.1.rc2 app/models/katello/content_view_docker_filter_rule.rb
katello-3.6.0.rc2 app/models/katello/content_view_docker_filter_rule.rb
katello-3.6.0.rc1 app/models/katello/content_view_docker_filter_rule.rb
katello-3.5.1.1 app/models/katello/content_view_docker_filter_rule.rb
katello-3.5.1 app/models/katello/content_view_docker_filter_rule.rb
katello-3.5.0.1 app/models/katello/content_view_docker_filter_rule.rb
katello-3.5.0 app/models/katello/content_view_docker_filter_rule.rb
katello-3.5.0.rc2 app/models/katello/content_view_docker_filter_rule.rb