Sha256: d9911d362e6a93931dfa590fb8d24a48f78e852df2db32fad5cdec8482694f8b

Contents?: true

Size: 771 Bytes

Versions: 46

Compression:

Stored size: 771 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
      item_repos = @item.repositories
      item_repos.where(:library_instance_id => @repository.id) if @repository

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

    def comparison_repositories
      repo = @item
      @versions.map(&:id) & repo&.published_in_versions&.pluck(: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

46 entries across 46 versions & 1 rubygems

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