Sha256: bfb2f66473fe8acc9c07a316690e7e179def2d146e7d5c83565b7cc87908f858
Contents?: true
Size: 616 Bytes
Versions: 24
Compression:
Stored size: 616 Bytes
Contents
# frozen_string_literal: true module Decidim module Admin # A form object used to officialize users from 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::User.find_by( id: user_id, organization: current_organization ) end end end end
Version data entries
24 entries across 24 versions & 1 rubygems