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-4.0.3 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.18.5 app/presenters/katello/content_view_version_compare_presenter.rb
katello-4.0.2.1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-4.0.2 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.18.4 app/presenters/katello/content_view_version_compare_presenter.rb
katello-4.0.1.2 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.18.3.1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-4.0.1.1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.18.3 app/presenters/katello/content_view_version_compare_presenter.rb
katello-4.0.1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-4.0.0 app/presenters/katello/content_view_version_compare_presenter.rb
katello-4.0.0.rc3.1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-4.0.0.rc3 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.18.2.1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.18.2 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.17.3 app/presenters/katello/content_view_version_compare_presenter.rb
katello-4.0.0.rc2 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.18.1.1 app/presenters/katello/content_view_version_compare_presenter.rb
katello-3.17.2 app/presenters/katello/content_view_version_compare_presenter.rb
katello-4.0.0.rc1 app/presenters/katello/content_view_version_compare_presenter.rb