Sha256: 3359b192b06ce6d9272fe03ab2e912b73b9b2cf64325c39631fa5fb902d38442
Contents?: true
Size: 773 Bytes
Versions: 36
Compression:
Stored size: 773 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 :email, :role, presence: true validates :name, presence: true validates :role, inclusion: { in: Decidim::AssemblyUserRole::ROLES } 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
36 entries across 36 versions & 1 rubygems