[TAN-8027] Bugfix: Editing cosponsors of an idea results in invitation notifications (and emails, if possible)#14163
Merged
jinjagit merged 3 commits intoJun 24, 2026
Conversation
Collaborator
|
jinjagit
commented
Jun 23, 2026
Comment on lines
+494
to
+507
| # phase_ids/cosponsor_ids must be assigned *after* SideFxIdeaService#before_update so it | ||
| # can snapshot the prior associations. Assigning them via assign_attributes (which mutates | ||
| # the persisted record immediately) would make the before/after diff empty — e.g. no | ||
| # newly-added cosponsors would be detected, so their invite notifications wouldn't be sent. | ||
| def extract_deferred_relationship_ids(update_params) | ||
| phase_ids = update_params.delete(:phase_ids) if update_params[:phase_ids] | ||
| cosponsor_ids = update_params.delete(:cosponsor_ids) if update_params.key?(:cosponsor_ids) | ||
| [phase_ids, cosponsor_ids] | ||
| end | ||
|
|
||
| def assign_deferred_relationship_ids(input, phase_ids, cosponsor_ids) | ||
| input.phase_ids = phase_ids if phase_ids | ||
| input.cosponsor_ids = cosponsor_ids unless cosponsor_ids.nil? | ||
| end |
Contributor
Author
There was a problem hiding this comment.
The use of phase_ids was not changed, but included here as I needed to refactor something to get past the 'Method has too many lines' Rubocop rule, and this refactor seemed the best way to include the new code whilst not making the method longer.
jamesspeake
approved these changes
Jun 24, 2026
jamesspeake
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me. One small comment
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
cosponsorship(s) created via anideacreate, everything seems to work fine.However, when
cosponsorship(s) were edited via anideaupdate, theLogActivityJob(s) needed to create theactivities, in turn needed to trigger thenotificationsinviting theuser(s) to accept thecosponsorship, were never created. 😬Changelog
Fixed