Sha256: abdd24880d0e72caa9b265ad56e0f997b66c64d71f0d7f4fdfff97a916509739

Contents?: true

Size: 501 Bytes

Versions: 26

Compression:

Stored size: 501 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Debates
    #
    # Decorator for debates
    #
    class DebatePresenter < SimpleDelegator
      def author
        @author ||= if official?
                      Decidim::Debates::OfficialAuthorPresenter.new
                    elsif user_group
                      Decidim::UserGroupPresenter.new(user_group)
                    else
                      Decidim::UserPresenter.new(super)
                    end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
decidim-debates-0.10.1 app/presenters/decidim/debates/debate_presenter.rb
decidim-debates-0.10.0 app/presenters/decidim/debates/debate_presenter.rb
decidim-debates-0.9.3 app/presenters/decidim/debates/debate_presenter.rb
decidim-debates-0.9.2 app/presenters/decidim/debates/debate_presenter.rb
decidim-debates-0.9.1 app/presenters/decidim/debates/debate_presenter.rb
decidim-debates-0.9.0 app/presenters/decidim/debates/debate_presenter.rb