Sha256: 2f96771e591e0380a602140e13e162acddc49e225ef0566ad6aef93ee92fcba1

Contents?: true

Size: 770 Bytes

Versions: 15

Compression:

Stored size: 770 Bytes

Contents

module Katello
  class ContentViewDockerFilterRule < Katello::Model
    self.include_root_in_json = false

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

    validates_lengths_from_database
    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

15 entries across 15 versions & 1 rubygems

Version Path
katello-3.4.5 app/models/katello/content_view_docker_filter_rule.rb
katello-3.4.4 app/models/katello/content_view_docker_filter_rule.rb
katello-3.4.2 app/models/katello/content_view_docker_filter_rule.rb
katello-3.4.1 app/models/katello/content_view_docker_filter_rule.rb
katello-3.4.0.2 app/models/katello/content_view_docker_filter_rule.rb
katello-3.4.0.1 app/models/katello/content_view_docker_filter_rule.rb
katello-3.3.2 app/models/katello/content_view_docker_filter_rule.rb
katello-3.4.0 app/models/katello/content_view_docker_filter_rule.rb
katello-3.4.0.rc2 app/models/katello/content_view_docker_filter_rule.rb
katello-3.4.0.rc1 app/models/katello/content_view_docker_filter_rule.rb
katello-3.3.1.1 app/models/katello/content_view_docker_filter_rule.rb
katello-3.3.1 app/models/katello/content_view_docker_filter_rule.rb
katello-3.3.0.1 app/models/katello/content_view_docker_filter_rule.rb
katello-3.3.0 app/models/katello/content_view_docker_filter_rule.rb
katello-3.3.0.rc2 app/models/katello/content_view_docker_filter_rule.rb