Sha256: e225baf1068d887b64197b168964b40b4af9f09d20b9398df065cea1c8bc341d

Contents?: true

Size: 939 Bytes

Versions: 239

Compression:

Stored size: 939 Bytes

Contents

module Katello
  class ContentViewVersionComponent < Katello::Model
    belongs_to :composite_version, :class_name => "Katello::ContentViewVersion", :inverse_of => :content_view_version_components
    belongs_to :component_version, :class_name => "Katello::ContentViewVersion", :inverse_of => :content_view_version_composites

    validates_lengths_from_database
    validate :content_view_types

    private

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

      if component_version.content_view.composite?
        errors.add(:base, _("Cannot add composite versions to another composite content view"))
      end

      if composite_version.default? || component_version.default?
        errors.add(:base, _("Cannot add default content view to composite content view"))
      end
    end
  end
end

Version data entries

239 entries across 239 versions & 1 rubygems

Version Path
katello-4.14.2 app/models/katello/content_view_version_component.rb
katello-4.15.0 app/models/katello/content_view_version_component.rb
katello-4.15.0.rc2 app/models/katello/content_view_version_component.rb
katello-4.15.0.rc1 app/models/katello/content_view_version_component.rb
katello-4.14.1 app/models/katello/content_view_version_component.rb
katello-4.14.0 app/models/katello/content_view_version_component.rb
katello-4.14.0.rc3 app/models/katello/content_view_version_component.rb
katello-4.14.0.rc2 app/models/katello/content_view_version_component.rb
katello-4.14.0.rc1.1 app/models/katello/content_view_version_component.rb
katello-4.14.0.rc1 app/models/katello/content_view_version_component.rb
katello-4.13.1 app/models/katello/content_view_version_component.rb
katello-4.13.0 app/models/katello/content_view_version_component.rb
katello-4.12.1 app/models/katello/content_view_version_component.rb
katello-4.13.0.rc1 app/models/katello/content_view_version_component.rb
katello-4.12.0 app/models/katello/content_view_version_component.rb
katello-4.12.0.rc3 app/models/katello/content_view_version_component.rb
katello-4.12.0.rc2 app/models/katello/content_view_version_component.rb
katello-4.12.0.rc1 app/models/katello/content_view_version_component.rb
katello-4.11.1 app/models/katello/content_view_version_component.rb
katello-4.11.0 app/models/katello/content_view_version_component.rb