Sha256: a7da6fa5a635a6393048f81e2dbd1043a24b9e499e8493b9ff10c1660ba12fce
Contents?: true
Size: 633 Bytes
Versions: 13
Compression:
Stored size: 633 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 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