Sha256: 3c56c4fd297d278b23daaf5e2a36ebea0d884b3ed89dc79d35f48297f406c7cb

Contents?: true

Size: 1.02 KB

Versions: 22

Compression:

Stored size: 1.02 KB

Contents

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

    belongs_to :content_view, :class_name => "Katello::ContentView",
                              :inverse_of => :content_view_components
    belongs_to :content_view_version, :class_name => "Katello::ContentViewVersion",
                                      :inverse_of => :content_view_components

    validates_lengths_from_database
    validates :content_view_version_id, :uniqueness => {:scope => :content_view_id}
    validate :content_view_types

    private

    def content_view_types
      unless content_view.composite?
        errors.add(:base, _("Cannot add component versions to a non-composite content view"))
      end
      if content_view_version.content_view.composite?
        errors.add(:base, _("Cannot add composite versions to a composite content view"))
      end
      if content_view_version.default?
        errors.add(:base, _("Cannot add default content view to composite content view"))
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
katello-3.1.0.1 app/models/katello/content_view_component.rb
katello-3.1.0 app/models/katello/content_view_component.rb
katello-3.1.0.rc2.1 app/models/katello/content_view_component.rb
katello-3.0.2 app/models/katello/content_view_component.rb
katello-2.4.5 app/models/katello/content_view_component.rb
katello-3.1.0.rc1 app/models/katello/content_view_component.rb
katello-3.0.1 app/models/katello/content_view_component.rb
katello-2.4.4 app/models/katello/content_view_component.rb
katello-3.0.0 app/models/katello/content_view_component.rb
katello-2.4.3 app/models/katello/content_view_component.rb
katello-3.0.0.rc7 app/models/katello/content_view_component.rb
katello-3.0.0.rc5 app/models/katello/content_view_component.rb
katello-2.4.2 app/models/katello/content_view_component.rb
katello-3.0.0.rc4 app/models/katello/content_view_component.rb
katello-3.0.0.rc3 app/models/katello/content_view_component.rb
katello-3.0.0.rc2 app/models/katello/content_view_component.rb
katello-3.0.0.rc1 app/models/katello/content_view_component.rb
katello-2.4.1 app/models/katello/content_view_component.rb
katello-2.4.0 app/models/katello/content_view_component.rb
katello-2.4.0.rc3 app/models/katello/content_view_component.rb