-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #442 from OpenSourcePolitics/rc-0.26
fix: Add module and fix notifications on proposal answers import
- Loading branch information
Showing
6 changed files
with
207 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
lib/extends/lib/decidim/proposals/imports/proposal_answer_creator_extends.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module ProposalAnswerCreatorExtends | ||
def notify | ||
# If the initial state is set to nil, then it will be set to "" as it is a non-answered proposal. | ||
# We still want to use further in the process and cannot read nil values. | ||
state = initial_state || "" | ||
::Decidim::Proposals::Admin::NotifyProposalAnswer.call(resource, state) | ||
end | ||
end | ||
|
||
Decidim::Proposals::Import::ProposalAnswerCreator.class_eval do | ||
prepend(ProposalAnswerCreatorExtends) | ||
end |
Oops, something went wrong.