Sha256: 9b9f820f6bfa578c56cb36340f9a35c3fe46dd993b3c57654dc63a69e7c44f69

Contents?: true

Size: 470 Bytes

Versions: 13

Compression:

Stored size: 470 Bytes

Contents

# frozen_string_literal: true

module Decidim
  #
  # Decorator for areas
  #
  class AreaPresenter < SimpleDelegator
    include Decidim::TranslationsHelper

    def translated_name
      @translated_name ||= translated_attribute name
    end

    def translated_name_with_type
      translated_type_name = area_type.presence && AreaTypePresenter.new(area_type).translated_name

      [translated_type_name, translated_name].compact_blank.join(" - ")
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/presenters/decidim/area_presenter.rb
decidim-core-0.28.4 app/presenters/decidim/area_presenter.rb
decidim-core-0.29.0 app/presenters/decidim/area_presenter.rb
decidim-core-0.28.3 app/presenters/decidim/area_presenter.rb
decidim-core-0.29.0.rc4 app/presenters/decidim/area_presenter.rb
decidim-core-0.29.0.rc3 app/presenters/decidim/area_presenter.rb
decidim-core-0.29.0.rc2 app/presenters/decidim/area_presenter.rb
decidim-core-0.29.0.rc1 app/presenters/decidim/area_presenter.rb
decidim-core-0.28.2 app/presenters/decidim/area_presenter.rb
decidim-core-0.28.1 app/presenters/decidim/area_presenter.rb
decidim-core-0.28.0 app/presenters/decidim/area_presenter.rb
decidim-core-0.28.0.rc5 app/presenters/decidim/area_presenter.rb
decidim-core-0.28.0.rc4 app/presenters/decidim/area_presenter.rb