Sha256: 5c13863c271f2a11baecaeb32357d9c28b721619a83ac50cb6e6b3e65467b2e8
Contents?: true
Size: 786 Bytes
Versions: 12
Compression:
Stored size: 786 Bytes
Contents
# frozen_string_literal: true module Decidim 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 :email, :role, presence: true validates :name, presence: true validates :role, inclusion: { in: Decidim::ParticipatoryProcessUserRole::ROLES } 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
Version data entries
12 entries across 12 versions & 2 rubygems