Sha256: 5b8d59c5fada0e0943b1e3ee2f4ef5b3950d5ab808d584d5b615daedfeab9e85

Contents?: true

Size: 774 Bytes

Versions: 91

Compression:

Stored size: 774 Bytes

Contents

module Katello
  class ContentViewVersionComparePresenter
    def initialize(content_item, content_view_versions, repository)
      @item = content_item
      @versions = content_view_versions
      @repository = repository
    end

    def comparison
      if @item.is_a?(::Katello::PuppetModule)
        item_repos = @item.content_view_puppet_environments
      else
        item_repos = @item.repositories
        item_repos.where(:library_instance_id => @repository.id) if @repository
      end

      item_repos.map(&:content_view_version_id) & @versions.map(&:id)
    end

    def respond_to?(method)
      return method.to_s == 'comparison' || @item.respond_to?(method)
    end

    def method_missing(*args, &block)
      @item.send(*args, &block)
    end
  end
end

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
katello-3.18.1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.18.0 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.17.1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.16.2 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.18.0.rc2.1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.18.0.rc2 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.17.0 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.18.0.rc1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.17.0.rc2.2 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.17.0.rc2.1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.16.1.2 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.16.1.1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.17.0.rc2 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.16.1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.17.0.rc1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.16.0 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.16.0.rc5.1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.16.0.rc5 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.16.0.rc4.1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.15.3.1 app/presenters/katello/content_view_version_compare_presenter.rb