Sha256: e51d539cecc5d8c52b7c635e61d85794d29f366b77af6cada52ec5262d544ae5

Contents?: true

Size: 407 Bytes

Versions: 13

Compression:

Stored size: 407 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    class ParticipatorySpaceAdminUserForm < ParticipatorySpacePrivateUserForm
      attribute :role, String

      validates :role, presence: true
      validates :role, inclusion: { in: ParticipatorySpaceUser::ROLES }

      def roles
        ParticipatorySpaceUser::ROLES.map { |role| [I18n.t(role, scope:), role] }
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-admin-0.29.1 app/forms/decidim/admin/participatory_space_admin_user_form.rb
decidim-admin-0.28.4 app/forms/decidim/admin/participatory_space_admin_user_form.rb
decidim-admin-0.29.0 app/forms/decidim/admin/participatory_space_admin_user_form.rb
decidim-admin-0.28.3 app/forms/decidim/admin/participatory_space_admin_user_form.rb
decidim-admin-0.29.0.rc4 app/forms/decidim/admin/participatory_space_admin_user_form.rb
decidim-admin-0.29.0.rc3 app/forms/decidim/admin/participatory_space_admin_user_form.rb
decidim-admin-0.29.0.rc2 app/forms/decidim/admin/participatory_space_admin_user_form.rb
decidim-admin-0.29.0.rc1 app/forms/decidim/admin/participatory_space_admin_user_form.rb
decidim-admin-0.28.2 app/forms/decidim/admin/participatory_space_admin_user_form.rb
decidim-admin-0.28.1 app/forms/decidim/admin/participatory_space_admin_user_form.rb
decidim-admin-0.28.0 app/forms/decidim/admin/participatory_space_admin_user_form.rb
decidim-admin-0.28.0.rc5 app/forms/decidim/admin/participatory_space_admin_user_form.rb
decidim-admin-0.28.0.rc4 app/forms/decidim/admin/participatory_space_admin_user_form.rb