app/commands/decidim/proposals/admin/notify_proposal_answer.rb in decidim-proposals-0.26.10 vs app/commands/decidim/proposals/admin/notify_proposal_answer.rb in decidim-proposals-0.27.0.rc1
- old
+ new
@@ -2,11 +2,11 @@
module Decidim
module Proposals
module Admin
# A command to notify about the change of the published state for a proposal.
- class NotifyProposalAnswer < Rectify::Command
+ class NotifyProposalAnswer < Decidim::Command
# Public: Initializes the command.
#
# proposal - The proposal to write the answer for.
# initial_state - The proposal state before the current process.
def initialize(proposal, initial_state)
@@ -19,11 +19,9 @@
# - :noop when the answer is not published or the state didn't changed.
# - :ok when everything is valid.
#
# Returns nothing.
def call
- return broadcast(:invalid) if proposal.blank?
-
if proposal.published_state? && state_changed?
transaction do
increment_score
notify_followers
end