Sha256: cf3fbf8ad286a1cc9502189fcc86eeda4b9acfbf74c00615d7d5228341032e15
Contents?: true
Size: 680 Bytes
Versions: 13
Compression:
Stored size: 680 Bytes
Contents
# frozen_string_literal: true module Decidim module Admin # A form object used to block users or user groups on the admin dashboard. class BlockUserForm < Form attribute :user_id, Integer attribute :justification, String attribute :hide, Boolean, default: false validates :user, presence: true validates :justification, presence: true, length: { minimum: UserBlock::MINIMUM_JUSTIFICATION_LENGTH } def map_model(user) self.user_id = user.id end def user @user ||= Decidim::UserBaseEntity.find_by( id: user_id, organization: current_organization ) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems