Sha256: a2713d5124ca615b1db2cf162638aeb4f2e3eec378e3622142fcae875a506221
Contents?: true
Size: 589 Bytes
Versions: 13
Compression:
Stored size: 589 Bytes
Contents
# frozen_string_literal: true module Decidim # This command unsubscribes user from newsletter. class UnsubscribeSettings < Rectify::Command # unsubscribe user from newsletter. # # user - The user to be updated. # newsletter_notifications - to be false def initialize(user) @user = user end def call return broadcast(:invalid) unless @user.newsletter_notifications update_settings @user.save! broadcast(:ok, @user) end private def update_settings @user.newsletter_notifications = false end end end
Version data entries
13 entries across 13 versions & 1 rubygems