Skip to content

Commit

Permalink
Added update for goverment_response_at
Browse files Browse the repository at this point in the history
  • Loading branch information
thatkevin committed Jan 12, 2024
1 parent cd31265 commit 99e861a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/models/archived/government_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class GovernmentResponse < ActiveRecord::Base

after_destroy do
# this will prevent EmailThresholdResponseJob from sending out emails for the deleted response
petition.set_email_requested_at_for('government_response')
petition.set_email_requested_at_for('government_response')
petition.update_columns(government_response_at: nil)
end

def responded_on
Expand Down
3 changes: 1 addition & 2 deletions app/models/government_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ class GovernmentResponse < ActiveRecord::Base

after_destroy do
# this will prevent EmailThresholdResponseJob from sending out emails for the deleted response
# TODO 'check that email requested at breaks here'
unless petition.archived?
petition.set_email_requested_at_for('government_response')
petition.update(government_response_at: nil)
petition.update_columns(government_response_at: nil)
end
end

Expand Down

0 comments on commit 99e861a

Please sign in to comment.