Sha256: aa130c7a10b23d5cda7d9c185f5c0e93e072054d858cc55adaef84607d167a99

Contents?: true

Size: 625 Bytes

Versions: 6

Compression:

Stored size: 625 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # This class contains helpers needed to format ParticipatoryProcessGroups
    # in order to use them in select forms.
    #
    module ProcessGroupsForSelectHelper
      # Public: A formatted collection of ParticipatoryProcessGroups to be used
      # in forms.
      #
      # Returns an Array.
      def process_groups_for_select
        @process_groups_for_select ||=
          OrganizationParticipatoryProcessGroups.new(current_organization).map do |group|
            [translated_attribute(group.name), group.id]
          end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
decidim-admin-0.5.1 app/helpers/decidim/admin/process_groups_for_select_helper.rb
decidim-0.5.1 decidim-admin/app/helpers/decidim/admin/process_groups_for_select_helper.rb
decidim-admin-0.5.0 app/helpers/decidim/admin/process_groups_for_select_helper.rb
decidim-0.5.0 decidim-admin/app/helpers/decidim/admin/process_groups_for_select_helper.rb
decidim-admin-0.4.4 app/helpers/decidim/admin/process_groups_for_select_helper.rb
decidim-0.4.4 decidim-admin/app/helpers/decidim/admin/process_groups_for_select_helper.rb