Sha256: 27b3957a3fb06dea5856ad028ed884d2f5f2fedaaf1cbfc964cd9d3f0365c1eb
Contents?: true
Size: 777 Bytes
Versions: 40
Compression:
Stored size: 777 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
40 entries across 40 versions & 2 rubygems