Sha256: e0c58389b4b9ec4f1b0996efb1575687b36c804f3592399fc90879b17630eaa4

Contents?: true

Size: 691 Bytes

Versions: 7

Compression:

Stored size: 691 Bytes

Contents

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

    belongs_to :filter,
               :class_name => "Katello::ContentViewErratumFilter",
               :inverse_of => :erratum_rules,
               :foreign_key => :content_view_filter_id

    serialize :types, Array

    validates_lengths_from_database
    validates :errata_id, :uniqueness => { :scope => :content_view_filter_id }, :allow_blank => true
    validates_with Validators::ContentViewErratumFilterRuleValidator

    def filter_has_date_or_type_rule?
      filter.erratum_rules.any? { |rule| rule.start_date || rule.end_date || !rule.types.blank? }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
katello-2.4.5 app/models/katello/content_view_erratum_filter_rule.rb
katello-2.4.4 app/models/katello/content_view_erratum_filter_rule.rb
katello-2.4.3 app/models/katello/content_view_erratum_filter_rule.rb
katello-2.4.2 app/models/katello/content_view_erratum_filter_rule.rb
katello-2.4.1 app/models/katello/content_view_erratum_filter_rule.rb
katello-2.4.0 app/models/katello/content_view_erratum_filter_rule.rb
katello-2.4.0.rc3 app/models/katello/content_view_erratum_filter_rule.rb