Sha256: e0c87483fbf4fe0a9857c58ac3e057f65ebed1e3c641ea7ade51db6af6ad4ee5
Contents?: true
Size: 778 Bytes
Versions: 14
Compression:
Stored size: 778 Bytes
Contents
# frozen_string_literal: true module Decidim module Admin # A command with all the business logic when verifying a user_group. class VerifyUserGroup < Rectify::Command # Public: Initializes the command. # # user_group - The user_group to verify def initialize(user_group) @user_group = user_group end # Executes the command. Broadcasts these events: # # - :ok when everything is valid. # # Returns nothing. def call return broadcast(:invalid) unless @user_group.valid? verify_user_group broadcast(:ok) end private def verify_user_group @user_group.update_attributes!(verified_at: Time.current, rejected_at: nil) end end end end
Version data entries
14 entries across 14 versions & 1 rubygems