Change syntax to delay dashboard emails

After updating to Rails5 It seems the after_action[1] in the dashboard's mailer is not beind called.

Using this syntax the emails are still being delayed and the after_action being called correctly.

[1] https://github.com/AyuntamientoMadrid/consul/pull/1945/files#diff-fdf5590f3241c439fcc9d2225c3cf4d8R3
This commit is contained in:
voodoorai2000
2019-04-25 17:32:15 +02:00
committed by decabeza
parent 20f505ab7c
commit 992f1d23a1
2 changed files with 6 additions and 6 deletions

View File

@@ -241,7 +241,7 @@ class Proposal < ApplicationRecord
new_actions = Dashboard::Action.detect_new_actions_since(Date.yesterday, self)
if new_actions.present?
Dashboard::Mailer.new_actions_notification_on_create(self).deliver_later
Dashboard::Mailer.delay.new_actions_notification_on_create(self)
end
end
@@ -249,7 +249,7 @@ class Proposal < ApplicationRecord
new_actions_ids = Dashboard::Action.detect_new_actions_since(Date.yesterday, self)
if new_actions_ids.present?
Dashboard::Mailer.new_actions_notification_on_published(self, new_actions_ids).deliver_later
Dashboard::Mailer.delay.new_actions_notification_on_published(self, new_actions_ids)
end
end

View File

@@ -7,11 +7,11 @@ namespace :dashboards do
if new_actions_ids.present?
if proposal.published?
Dashboard::Mailer.new_actions_notification_rake_published(proposal,
new_actions_ids).deliver_later
Dashboard::Mailer.delay.new_actions_notification_rake_published(proposal,
new_actions_ids)
else
Dashboard::Mailer.new_actions_notification_rake_created(proposal,
new_actions_ids).deliver_later
Dashboard::Mailer.delay.new_actions_notification_rake_created(proposal,
new_actions_ids)
end
end
end