OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Strip sent_mail into two columns mail_alert_sent and mail_reminder_sent
Oliver Günther528ca50faa16
diff --git a/app/contracts/notifications/create_contract.rb b/app/contracts/notifications/create_contract.rbindex 4a370888222..3211d0fd119 100644--- a/app/contracts/notifications/create_contract.rb+++ b/app/contracts/notifications/create_contract.rb@@ -37,7 +37,8 @@ module Notificationsattribute :journalattribute :resource_typeattribute :read_ian- attribute :sent_mail+ attribute :mail_reminder_sent+ attribute :mail_alert_sentvalidate :validate_recipient_presentvalidate :validate_reason_present@@ -49,7 +50,8 @@ module Notificationsenddef validate_sent- errors.add(:sent_mail, :set_on_creation) if model.sent_mail+ errors.add(:mail_reminder_sent, :set_on_creation) if model.mail_reminder_sent+ errors.add(:mail_alert_sent, :set_on_creation) if model.mail_alert_sentenddef validate_recipient_presentdiff --git a/app/models/notification.rb b/app/models/notification.rbindex b3d39d32fe9..729264d6cad 100644--- a/app/models/notification.rb+++ b/app/models/notification.rb@@ -23,6 +23,7 @@ class Notification < ApplicationRecordinclude Scopes::Scopedscopes :unsent_reminders_before,- :unsent_mail,+ :mail_reminder_unsent,+ :mail_alert_unsent,:recipientenddiff --git a/app/models/notifications/scopes/mail_alert_unsent.rb b/app/models/notifications/scopes/mail_alert_unsent.rbnew file mode 100644index 00000000000..277d014b50e--- /dev/null+++ b/app/models/notifications/scopes/mail_alert_unsent.rb@@ -0,0 +1,42 @@+#-- encoding: UTF-8++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2021 the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See COPYRIGHT and LICENSE files for more details.+#++++# Return alert mail notifications that are unread (have mail_alert_sent: false)+module Notifications::Scopes+ module MailAlertUnsent+ extend ActiveSupport::Concern++ class_methods do+ def mail_alert_unsent+ where(mail_alert_unsent: false)+ end+ end+ end+enddiff --git a/app/models/notifications/scopes/unsent_mail.rb b/app/models/notifications/scopes/mail_reminder_unsent.rbsimilarity index 93%rename from app/models/notifications/scopes/unsent_mail.rbrename to app/models/notifications/scopes/mail_reminder_unsent.rbindex a1d422938cf..c35daf0963b 100644--- a/app/models/notifications/scopes/unsent_mail.rb+++ b/app/models/notifications/scopes/mail_reminder_unsent.rb@@ -30,12 +30,12 @@# Return digest mail notifications that are unread (have read_digest_mail: false)module Notifications::Scopes- module UnsentMail+ module MailReminderUnsentextend ActiveSupport::Concernclass_methods do- def unsent_mail- where(sent_mail: false)+ def mail_reminder_unsent+ where(mail_reminder_sent: false)endendenddiff --git a/app/models/notifications/scopes/unsent_reminders_before.rb b/app/models/notifications/scopes/unsent_reminders_before.rbindex 1355f9d79f1..d557eb9fd03 100644--- a/app/models/notifications/scopes/unsent_reminders_before.rb+++ b/app/models/notifications/scopes/unsent_reminders_before.rb@@ -39,7 +39,7 @@ module Notifications::Scopeswhere(Notification.arel_table[:created_at].lteq(time)).where(recipient: recipient).where("read_ian IS NULL OR read_ian IS FALSE")- .where(sent_mail: false)+ .where(mail_reminder_sent: false)endendenddiff --git a/app/services/notifications/create_from_model_service.rb b/app/services/notifications/create_from_model_service.rbindex 344b3e74364..474d845a000 100644--- a/app/services/notifications/create_from_model_service.rb+++ b/app/services/notifications/create_from_model_service.rb@@ -69,7 +69,7 @@ class Notifications::CreateFromModelServiceactor: user_with_fallback,reason: reasons.first,read_ian: false,- sent_mail: false+ mail_reminder_sent: false}Notifications::CreateServicediff --git a/app/services/notifications/mail_service.rb b/app/services/notifications/mail_service.rbindex 095cfa11b06..5d5461bcc84 100644--- a/app/services/notifications/mail_service.rb+++ b/app/services/notifications/mail_service.rb@@ -72,5 +72,9 @@ module Notificationsdef supported?strategy.present?end++ def notification_marked_attribute+ :mail_alert_sent+ endendenddiff --git a/app/workers/mails/reminder_job.rb b/app/workers/mails/reminder_job.rbindex f9abbd2efd5..fb3d39b6348 100644--- a/app/workers/mails/reminder_job.rb+++ b/app/workers/mails/reminder_job.rb@@ -33,6 +33,10 @@ class Mails::ReminderJob < Mails::DeliverJobprivate+ def notification_marked_attribute+ :mail_reminder_sent+ end+def render_mail# Have to cast to array since the update in the subsequent block# will result in the notification to not be found via the .unsent_reminders_before scope.@@ -48,8 +52,8 @@ class Mails::ReminderJob < Mails::DeliverJob# Running the digest job will take some time to complete.# Within this timeframe, new notifications might come in. Upon notification creation- # a job is scheduled unless there is no prior digest notification that is not yet read (sent_mail: true).- # If we were to only set the sent_mail state at the end of the mail rendering an edge case of the following+ # a job is scheduled unless there is no prior digest notification that is not yet read (mail_reminder_sent: true).+ # If we were to only set the mail_reminder_sent state at the end of the mail rendering an edge case of the following# would lead to digest not being sent or at least sent unduly late:# * Job starts and fetches the notifications for rendering. We need to fetch all notifications to be rendered to# order them as desired.diff --git a/app/workers/notifications/with_marked_notifications.rb b/app/workers/notifications/with_marked_notifications.rbindex 4fdf34f046a..dfa6eec51fe 100644--- a/app/workers/notifications/with_marked_notifications.rb+++ b/app/workers/notifications/with_marked_notifications.rb@@ -46,7 +46,9 @@ module Notificationsenddef mark_notifications_sent(notification_ids)- Notification.where(id: Array(notification_ids)).update_all(sent_mail: true, updated_at: Time.current)+ Notification+ .where(id: Array(notification_ids))+ .update_all(notification_marked_attribute => true, updated_at: Time.current)endendenddiff --git a/app/workers/notifications/workflow_job.rb b/app/workers/notifications/workflow_job.rbindex 67775f28419..dcb983dd2c0 100644--- a/app/workers/notifications/workflow_job.rb+++ b/app/workers/notifications/workflow_job.rb@@ -65,8 +65,7 @@ class Notifications::WorkflowJob < ApplicationJobNotification.where(id: notification_ids)- .unsent_mail- .where(reason: NotificationSetting.email_settings)+ .mail_alert_unsent.each do |notification|Notifications::MailService.new(notification)diff --git a/config/locales/en.yml b/config/locales/en.ymlindex dfd43eb43bb..0c4680fb838 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -686,7 +686,7 @@ en:attributes:read_ian:read_on_creation: 'cannot be set to true on notification creation.'- sent_mail:+ mail_reminder_sent:set_on_creation: 'cannot be set to true on notification creation.'reason:no_notification_reason: 'cannot be blank as IAN is chosen as a channel.'diff --git a/db/migrate/20210914065555_cleanup_notifications.rb b/db/migrate/20210914065555_cleanup_notifications.rbindex f1db1151997..e1a15b44416 100644--- a/db/migrate/20210914065555_cleanup_notifications.rb+++ b/db/migrate/20210914065555_cleanup_notifications.rb@@ -3,7 +3,8 @@ class CleanupNotifications < ActiveRecord::Migration[6.1]change_table :notifications, bulk: true do |t|t.remove :read_mail, :reason_mail, :reason_mail_digestt.rename :reason_ian, :reason- t.rename :read_mail_digest, :sent_mail+ t.rename :read_mail_digest, :mail_reminder_sent+ t.boolean :mail_alert_sent, default: nil, index: trueendchange_table :notification_settings, bulk: true do |t|@@ -33,7 +34,7 @@ class CleanupNotifications < ActiveRecord::Migration[6.1]t.boolean :read_mail, default: false, index: truet.integer :reason_mail, limit: 1t.integer :reason_mail_digest, limit: 1- t.rename :sent_mail, :read_mail_digest+ t.rename :mail_reminder_sent, :read_mail_digestt.rename :reason, :reason_ianenddiff --git a/modules/documents/spec/services/notifications/create_from_model_service_document_spec.rb b/modules/documents/spec/services/notifications/create_from_model_service_document_spec.rbindex 9a77006ad44..20450e8d44d 100644--- a/modules/documents/spec/services/notifications/create_from_model_service_document_spec.rb+++ b/modules/documents/spec/services/notifications/create_from_model_service_document_spec.rb@@ -63,7 +63,7 @@ describe Notifications::CreateFromModelService, 'document', with_settings: { jou{read_ian: nil,reason: false,- sent_mail: nil+ mail_reminder_sent: nil}endend@@ -110,7 +110,7 @@ describe Notifications::CreateFromModelService, 'document', with_settings: { jou{read_ian: nil,reason: false,- sent_mail: nil+ mail_reminder_sent: nil}endenddiff --git a/spec/contracts/notifications/create_contract_spec.rb b/spec/contracts/notifications/create_contract_spec.rbindex afb0ec4f062..9c3e69d99b5 100644--- a/spec/contracts/notifications/create_contract_spec.rb+++ b/spec/contracts/notifications/create_contract_spec.rb@@ -43,7 +43,7 @@ describe Notifications::CreateContract dolet(:notification_subject) { 'Some text' }let(:notification_reason) { :mentioned }let(:notification_read_ian) { false }- let(:notification_sent_mail) { false }+ let(:notification_mail_reminder_sent) { false }let(:notification) doNotification.new(project: notification_context,@@ -52,7 +52,7 @@ describe Notifications::CreateContract doreason: notification_reason,resource: notification_resource,read_ian: notification_read_ian,- sent_mail: notification_sent_mail)+ mail_reminder_sent: notification_mail_reminder_sent)endlet(:contract) { described_class.new(notification, current_user) }@@ -98,10 +98,10 @@ describe Notifications::CreateContract doit_behaves_like 'contract is invalid', read_ian: :read_on_creationend- context 'with sent_mail true' do- let(:notification_sent_mail) { true }+ context 'with mail_reminder_sent true' do+ let(:notification_mail_reminder_sent) { true }- it_behaves_like 'contract is invalid', sent_mail: :set_on_creation+ it_behaves_like 'contract is invalid', mail_reminder_sent: :set_on_creationendendenddiff --git a/spec/factories/notification_factory.rb b/spec/factories/notification_factory.rbindex 6867fe2624d..0b2164539c4 100644--- a/spec/factories/notification_factory.rb+++ b/spec/factories/notification_factory.rb@@ -2,7 +2,7 @@ FactoryBot.define dofactory :notification dosubject { "MyText" } # rubocop:disable RSpec/EmptyLineAfterSubjectread_ian { false }- sent_mail { false }+ mail_reminder_sent { false }reason { :mentioned }recipient factory: :userproject { association :project }diff --git a/spec/models/notifications/scopes/unread_mail_digest_spec.rb b/spec/models/notifications/scopes/reminder_mail_unsent.rbsimilarity index 88%rename from spec/models/notifications/scopes/unread_mail_digest_spec.rbrename to spec/models/notifications/scopes/reminder_mail_unsent.rbindex 851f06fa60e..d7ebb805039 100644--- a/spec/models/notifications/scopes/unread_mail_digest_spec.rb+++ b/spec/models/notifications/scopes/reminder_mail_unsent.rb@@ -28,13 +28,13 @@require 'spec_helper'-describe Notifications::Scopes::UnreadMailDigest, type: :model do+describe Notifications::Scopes::MailReminderUnsent, type: :model dodescribe '.unread_digest_mail' do- subject(:scope) { ::Notification.unsent_mail }+ subject(:scope) { ::Notification.mail_reminder_unsent }- let(:no_mail_notification) { FactoryBot.create(:notification, sent_mail: nil) }- let(:unread_mail_notification) { FactoryBot.create(:notification, sent_mail: false) }- let(:read_mail_notification) { FactoryBot.create(:notification, sent_mail: true) }+ let(:no_mail_notification) { FactoryBot.create(:notification, mail_reminder_sent: nil) }+ let(:unread_mail_notification) { FactoryBot.create(:notification, mail_reminder_sent: false) }+ let(:read_mail_notification) { FactoryBot.create(:notification, mail_reminder_sent: true) }before dono_mail_notificationdiff --git a/spec/models/notifications/scopes/unsent_reminders_before_spec.rb b/spec/models/notifications/scopes/unsent_reminders_before_spec.rbindex 410998bcf3b..c4bbe9c5b63 100644--- a/spec/models/notifications/scopes/unsent_reminders_before_spec.rb+++ b/spec/models/notifications/scopes/unsent_reminders_before_spec.rb@@ -42,10 +42,10 @@ describe Notifications::Scopes::UnsentRemindersBefore, type: :model dolet(:notification) doFactoryBot.create(:notification,recipient: notification_recipient,- sent_mail: notification_sent_mail,+ mail_reminder_sent: notification_mail_reminder_sent,created_at: notification_created_at)end- let(:notification_sent_mail) { false }+ let(:notification_mail_reminder_sent) { false }let(:notification_read_ian) { false }let(:notification_created_at) { Time.current - 10.minutes }let(:notification_recipient) { recipient }@@ -79,13 +79,13 @@ describe Notifications::Scopes::UnsentRemindersBefore, type: :model doendcontext 'with a unread and not reminded notification created before the time and for the user' do- let(:notification_sent_mail) { nil }+ let(:notification_mail_reminder_sent) { nil }it_behaves_like 'is empty'endcontext 'with a unread but reminded notification created before the time and for the user' do- let(:notification_sent_mail) { true }+ let(:notification_mail_reminder_sent) { true }it_behaves_like 'is empty'enddiff --git a/spec/services/notifications/create_from_journal_job_shared.rb b/spec/services/notifications/create_from_journal_job_shared.rbindex 41df103a6cc..9f7adbb0b59 100644--- a/spec/services/notifications/create_from_journal_job_shared.rb+++ b/spec/services/notifications/create_from_journal_job_shared.rb@@ -73,7 +73,7 @@ shared_context 'with CreateFromJournalJob context' do{read_ian: false,reason: :mentioned,- sent_mail: false+ mail_reminder_sent: false}endlet(:notification) { FactoryBot.build_stubbed(:notification) }diff --git a/spec/services/notifications/create_from_model_service_comment_spec.rb b/spec/services/notifications/create_from_model_service_comment_spec.rbindex 67c5f23c43a..afca64d0191 100644--- a/spec/services/notifications/create_from_model_service_comment_spec.rb+++ b/spec/services/notifications/create_from_model_service_comment_spec.rb@@ -68,7 +68,7 @@ describe Notifications::CreateFromModelService, 'comment', with_settings: { jour{read_ian: nil,reason: false,- sent_mail: nil+ mail_reminder_sent: nil}endend@@ -111,7 +111,7 @@ describe Notifications::CreateFromModelService, 'comment', with_settings: { jourread_ian: nil,reason: false,read_mail: false,- sent_mail: nil+ mail_reminder_sent: nil}endenddiff --git a/spec/services/notifications/create_from_model_service_message_spec.rb b/spec/services/notifications/create_from_model_service_message_spec.rbindex 6cd6317e6b9..3700b3dee12 100644--- a/spec/services/notifications/create_from_model_service_message_spec.rb+++ b/spec/services/notifications/create_from_model_service_message_spec.rb@@ -69,7 +69,7 @@ describe Notifications::CreateFromModelService, 'message', with_settings: { jour{read_ian: nil,reason: false,- sent_mail: nil+ mail_reminder_sent: nil}endend@@ -111,7 +111,7 @@ describe Notifications::CreateFromModelService, 'message', with_settings: { jour{read_ian: nil,reason: false,- sent_mail: nil+ mail_reminder_sent: nil}endend@@ -157,7 +157,7 @@ describe Notifications::CreateFromModelService, 'message', with_settings: { jour{read_ian: nil,reason: false,- sent_mail: nil+ mail_reminder_sent: nil}endend@@ -198,7 +198,7 @@ describe Notifications::CreateFromModelService, 'message', with_settings: { jour{read_ian: nil,reason: false,- sent_mail: nil+ mail_reminder_sent: nil}endend@@ -240,7 +240,7 @@ describe Notifications::CreateFromModelService, 'message', with_settings: { jour{read_ian: nil,reason: false,- sent_mail: nil+ mail_reminder_sent: nil}endend@@ -286,7 +286,7 @@ describe Notifications::CreateFromModelService, 'message', with_settings: { jour{read_ian: nil,reason: false,- sent_mail: nil+ mail_reminder_sent: nil}endenddiff --git a/spec/services/notifications/create_from_model_service_news_spec.rb b/spec/services/notifications/create_from_model_service_news_spec.rbindex 8f49c4e69af..b37b321c451 100644--- a/spec/services/notifications/create_from_model_service_news_spec.rb+++ b/spec/services/notifications/create_from_model_service_news_spec.rb@@ -61,7 +61,7 @@ describe Notifications::CreateFromModelService, 'news', with_settings: { journal{read_ian: nil,reason: false,- sent_mail: nil+ mail_reminder_sent: nil}endenddiff --git a/spec/services/notifications/create_from_model_service_wiki_spec.rb b/spec/services/notifications/create_from_model_service_wiki_spec.rbindex 20ccde1de25..d6a758ce080 100644--- a/spec/services/notifications/create_from_model_service_wiki_spec.rb+++ b/spec/services/notifications/create_from_model_service_wiki_spec.rb@@ -68,7 +68,7 @@ describe Notifications::CreateFromModelService, 'wiki', with_settings: { journalread_ian: nil,reason: false,read_mail: false,- sent_mail: nil+ mail_reminder_sent: nil}endend@@ -111,7 +111,7 @@ describe Notifications::CreateFromModelService, 'wiki', with_settings: { journalread_ian: nil,reason: false,read_mail: false,- sent_mail: nil+ mail_reminder_sent: nil}endend@@ -160,7 +160,7 @@ describe Notifications::CreateFromModelService, 'wiki', with_settings: { journal{read_ian: nil,reason: false,- sent_mail: nil+ mail_reminder_sent: nil}endend@@ -202,7 +202,7 @@ describe Notifications::CreateFromModelService, 'wiki', with_settings: { journal{read_ian: nil,reason: false,- sent_mail: nil+ mail_reminder_sent: nil}endend@@ -248,7 +248,7 @@ describe Notifications::CreateFromModelService, 'wiki', with_settings: { journal{read_ian: nil,reason: false,- sent_mail: nil+ mail_reminder_sent: nil}endenddiff --git a/spec/services/notifications/create_from_model_service_work_package_spec.rb b/spec/services/notifications/create_from_model_service_work_package_spec.rbindex 1ef1ee71efa..1aa3cf48fba 100644--- a/spec/services/notifications/create_from_model_service_work_package_spec.rb+++ b/spec/services/notifications/create_from_model_service_work_package_spec.rb@@ -114,7 +114,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :assigned,- sent_mail: false+ mail_reminder_sent: false}endend@@ -131,7 +131,7 @@ describe Notifications::CreateFromModelService,{read_ian: nil,reason: nil,- sent_mail: false+ mail_reminder_sent: false}endend@@ -149,7 +149,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :assigned,- sent_mail: nil+ mail_reminder_sent: nil}endend@@ -177,7 +177,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :assigned,- sent_mail: false+ mail_reminder_sent: false}endend@@ -220,7 +220,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :responsible,- sent_mail: false+ mail_reminder_sent: false}endend@@ -237,7 +237,7 @@ describe Notifications::CreateFromModelService,{read_ian: nil,reason: nil,- sent_mail: false+ mail_reminder_sent: false}endend@@ -255,7 +255,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :responsible,- sent_mail: nil+ mail_reminder_sent: nil}endend@@ -308,7 +308,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :watched,- sent_mail: false+ mail_reminder_sent: false}endend@@ -325,7 +325,7 @@ describe Notifications::CreateFromModelService,{read_ian: nil,reason: nil,- sent_mail: false+ mail_reminder_sent: false}endend@@ -343,7 +343,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :watched,- sent_mail: nil+ mail_reminder_sent: nil}endend@@ -391,7 +391,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :subscribed,- sent_mail: false+ mail_reminder_sent: false}endend@@ -408,7 +408,7 @@ describe Notifications::CreateFromModelService,{read_ian: nil,reason: nil,- sent_mail: false+ mail_reminder_sent: false}endend@@ -426,7 +426,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :created,- sent_mail: nil+ mail_reminder_sent: nil}endend@@ -455,7 +455,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :subscribed,- sent_mail: false+ mail_reminder_sent: false}endend@@ -504,7 +504,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :created,- sent_mail: false+ mail_reminder_sent: false}endend@@ -559,7 +559,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :commented,- sent_mail: false+ mail_reminder_sent: false}endend@@ -607,7 +607,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :processed,- sent_mail: false+ mail_reminder_sent: false}endend@@ -655,7 +655,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :prioritized,- sent_mail: false+ mail_reminder_sent: false}endend@@ -704,7 +704,7 @@ describe Notifications::CreateFromModelService,read_ian: false,reason: :scheduled,read_mail: false,- sent_mail: false+ mail_reminder_sent: false}endend@@ -752,7 +752,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :scheduled,- sent_mail: false+ mail_reminder_sent: false}endend@@ -784,7 +784,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :assigned,- sent_mail: false+ mail_reminder_sent: false}endend@@ -805,7 +805,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :mentioned,- sent_mail: false+ mail_reminder_sent: false}endend@@ -836,7 +836,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :mentioned,- sent_mail: false+ mail_reminder_sent: false}endend@@ -854,7 +854,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :mentioned,- sent_mail: false+ mail_reminder_sent: false}endend@@ -869,7 +869,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :mentioned,- sent_mail: false+ mail_reminder_sent: false}endend@@ -883,7 +883,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :mentioned,- sent_mail: false+ mail_reminder_sent: false}endend@@ -901,7 +901,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :mentioned,- sent_mail: false+ mail_reminder_sent: false}endend@@ -919,7 +919,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :mentioned,- sent_mail: false+ mail_reminder_sent: false}endenddiff --git a/spec/services/notifications/set_attributes_service_spec.rb b/spec/services/notifications/set_attributes_service_spec.rbindex 80bc335de58..ed973871735 100644--- a/spec/services/notifications/set_attributes_service_spec.rb+++ b/spec/services/notifications/set_attributes_service_spec.rb@@ -100,7 +100,7 @@ describe Notifications::SetAttributesService, type: :model dorecipient_id: 1,subject: event_subject,read_ian: false,- sent_mail: false+ mail_reminder_sent: false})end@@ -136,7 +136,7 @@ describe Notifications::SetAttributesService, type: :model dojournal_id: journal.id,recipient_id: 1,read_ian: false,- sent_mail: false+ mail_reminder_sent: false})endenddiff --git a/spec/workers/mails/reminder_job_spec.rb b/spec/workers/mails/reminder_job_spec.rbindex 7d410e1c5d0..76419a76cbd 100644--- a/spec/workers/mails/reminder_job_spec.rb+++ b/spec/workers/mails/reminder_job_spec.rb@@ -89,7 +89,7 @@ describe Mails::ReminderJob, type: :model doexpect(notifications).to have_received(:update_all)- .with(sent_mail: true, updated_at: Time.current)+ .with(mail_reminder_sent: true, updated_at: Time.current)endit 'impersonates the recipient' dodiff --git a/spec/workers/notifications/workflow_job_spec.rb b/spec/workers/notifications/workflow_job_spec.rbindex cf919f03391..c10f630cc0c 100644--- a/spec/workers/notifications/workflow_job_spec.rb+++ b/spec/workers/notifications/workflow_job_spec.rb@@ -109,7 +109,7 @@ describe Notifications::WorkflowJob, type: :model doendbefore do- scope = class_double(Notification, unread_mail: [notifications.first])+ scope = class_double(Notification, mail_alert_unsent: [notifications.first])allow(Notification).to receive(:where)