Allow detect new actions since a custom date

- Rename method "detect_new_actions" to "detect_new_actions_since". Add new param date.
This commit is contained in:
taitus
2019-03-13 23:27:18 +01:00
parent b115c3af49
commit 8b1c458fdf
4 changed files with 25 additions and 25 deletions

View File

@@ -240,7 +240,7 @@ class Proposal < ActiveRecord::Base
end
def send_new_actions_notification_on_create
new_actions = Dashboard::Action.detect_new_actions(self)
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
@@ -248,7 +248,7 @@ class Proposal < ActiveRecord::Base
end
def send_new_actions_notification_on_published
new_actions_ids = Dashboard::Action.detect_new_actions(self)
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