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:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user