Fix restore notifications from admins page
The restore feature was not working properly. When pushed, the button was removing the notification from the admins panel, but it was not restoring in the proposal. I added an `after_restore` function (that I missed in the first PR) so that the notification is unmarked as moderated.
This commit is contained in:
@@ -45,6 +45,10 @@ class ProposalNotification < ActiveRecord::Base
|
|||||||
ignored_at.present?
|
ignored_at.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def after_restore
|
||||||
|
update(moderated: false)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def set_author
|
def set_author
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ feature 'Admin proposal notifications' do
|
|||||||
|
|
||||||
expect(proposal_notification.reload).not_to be_hidden
|
expect(proposal_notification.reload).not_to be_hidden
|
||||||
expect(proposal_notification).to be_ignored
|
expect(proposal_notification).to be_ignored
|
||||||
|
expect(proposal_notification).not_to be_moderated
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Confirm hide' do
|
scenario 'Confirm hide' do
|
||||||
|
|||||||
Reference in New Issue
Block a user