Sha256: 2c1d6c599dcfe6535a630b16e09ff32c7302ece14ed8210f2ebbfe91465fb362
Contents?: true
Size: 907 Bytes
Versions: 42
Compression:
Stored size: 907 Bytes
Contents
# frozen_string_literal: true module Decidim module ParticipatoryProcesses module Admin # A form object used to create participatory process user roles from the # admin dashboard. # class ParticipatoryProcessUserRoleForm < Form mimic :participatory_process_user_role attribute :name, String attribute :email, String attribute :role, String validates :name, :email, :role, presence: true validates :role, inclusion: { in: Decidim::ParticipatoryProcessUserRole::ROLES } validates :name, format: { with: UserBaseEntity::REGEXP_NAME } def roles Decidim::ParticipatoryProcessUserRole::ROLES.map do |role| [ I18n.t(role, scope: "decidim.admin.models.participatory_process_user_role.roles"), role ] end end end end end end
Version data entries
42 entries across 42 versions & 1 rubygems