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