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
Rename remainders of reason_ian to reason
Oliver Güntherb91faeac6a4e
diff --git a/app/models/queries/notifications/filters/reason_filter.rb b/app/models/queries/notifications/filters/reason_filter.rbindex 8edb8da063b..b667865f5fa 100644--- a/app/models/queries/notifications/filters/reason_filter.rb+++ b/app/models/queries/notifications/filters/reason_filter.rb@@ -30,7 +30,7 @@class Queries::Notifications::Filters::ReasonFilter < Queries::Notifications::Filters::NotificationFilterdef allowed_values- Notification.reason_ians.keys.map { |reason| [reason, reason] }+ Notification.reasons.keys.map { |reason| [reason, reason] }enddef type@@ -38,7 +38,7 @@ class Queries::Notifications::Filters::ReasonFilter < Queries::Notifications::Fienddef where- id_values = values.map { |value| Notification.reason_ians[value] }- operator_strategy.sql_for_field(id_values, self.class.model.table_name, :reason_ian)+ id_values = values.map { |value| Notification.reasons[value] }+ operator_strategy.sql_for_field(id_values, self.class.model.table_name, :reason)endenddiff --git a/app/models/queries/notifications/group_bys/group_by_reason.rb b/app/models/queries/notifications/group_bys/group_by_reason.rbindex 343038db3a9..c09c9b87aba 100644--- a/app/models/queries/notifications/group_bys/group_by_reason.rb+++ b/app/models/queries/notifications/group_bys/group_by_reason.rb@@ -36,6 +36,6 @@ class Queries::Notifications::GroupBys::GroupByReason < Queries::GroupBys::Baseenddef name- :reason_ian+ :reasonendenddiff --git a/app/models/queries/notifications/orders/reason_order.rb b/app/models/queries/notifications/orders/reason_order.rbindex 90f508539ca..26b6234ce89 100644--- a/app/models/queries/notifications/orders/reason_order.rb+++ b/app/models/queries/notifications/orders/reason_order.rb@@ -36,6 +36,6 @@ class Queries::Notifications::Orders::ReasonOrder < Queries::Orders::Baseenddef name- :reason_ian+ :reasonendenddiff --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 42b624c9840..27dac200425 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@@ -61,9 +61,9 @@ describe Notifications::CreateFromModelService, 'document', with_settings: { jouit_behaves_like 'creates notification' dolet(:notification_channel_reasons) do{- read_ian: nil,- reason: false,- mail_reminder_sent: nil+ read_ian: false,+ reason: :subscribed,+ mail_reminder_sent: false}endend@@ -108,9 +108,9 @@ describe Notifications::CreateFromModelService, 'document', with_settings: { jouit_behaves_like 'creates notification' dolet(:notification_channel_reasons) do{- read_ian: nil,- reason: false,- mail_reminder_sent: nil+ read_ian: false,+ reason: :subscribed,+ mail_reminder_sent: false}endenddiff --git a/spec/models/queries/notifications/notification_query_spec.rb b/spec/models/queries/notifications/notification_query_spec.rbindex 5321cf1c3d1..e7dab0b5e4f 100644--- a/spec/models/queries/notifications/notification_query_spec.rb+++ b/spec/models/queries/notifications/notification_query_spec.rb@@ -135,7 +135,7 @@ describe Queries::Notifications::NotificationQuery, type: :model doexpected = <<~SQL.squishSELECT "notifications".* FROM "notifications"WHERE "notifications"."recipient_id" = #{recipient.id}- ORDER BY "notifications"."reason_ian" DESC, "notifications"."id" DESC+ ORDER BY "notifications"."reason" DESC, "notifications"."id" DESCSQLexpect(instance.results.to_sql).to eql expected@@ -171,10 +171,10 @@ describe Queries::Notifications::NotificationQuery, type: :model dodescribe '#results' doit 'is the same as handwriting the query' doexpected = <<~SQL.squish- SELECT "notifications"."reason_ian", COUNT(*) FROM "notifications"+ SELECT "notifications"."reason", COUNT(*) FROM "notifications"WHERE "notifications"."recipient_id" = #{recipient.id}- GROUP BY "notifications"."reason_ian"- ORDER BY "notifications"."reason_ian" ASC+ GROUP BY "notifications"."reason"+ ORDER BY "notifications"."reason" ASCSQLexpect(instance.groups.to_sql).to eql expecteddiff --git a/spec/requests/api/v3/notifications/index_resource_spec.rb b/spec/requests/api/v3/notifications/index_resource_spec.rbindex 9202ccf5b25..bd0cf0617e1 100644--- a/spec/requests/api/v3/notifications/index_resource_spec.rb+++ b/spec/requests/api/v3/notifications/index_resource_spec.rb@@ -81,15 +81,6 @@ describe ::API::V3::Notifications::NotificationsAPI,it_behaves_like 'API V3 collection response', 2, 2, 'Notification'- context 'with a digest notification' do- let(:digest_notification) { FactoryBot.create :notification, recipient: recipient, reason: nil }- let(:notifications) { [notification1, notification2, digest_notification] }-- it_behaves_like 'API V3 collection response', 2, 2, 'Notification' do- let(:elements) { [notification2, notification1] }- end- end-context 'with a readIAN filter' dolet(:nil_notification) { FactoryBot.create :notification, recipient: recipient, read_ian: nil }@@ -171,7 +162,7 @@ describe ::API::V3::Notifications::NotificationsAPI,context 'with a reason filter' dolet(:notification3) doFactoryBot.create :notification,- reason_ian: :assigned,+ reason: :assigned,recipient: recipient,resource: work_package,project: work_package.project,@@ -179,7 +170,7 @@ describe ::API::V3::Notifications::NotificationsAPI,endlet(:notification4) doFactoryBot.create :notification,- reason_ian: :responsible,+ reason: :responsible,recipient: recipient,resource: work_package,project: work_package.project,@@ -192,7 +183,7 @@ describe ::API::V3::Notifications::NotificationsAPI,{'reason' => {'operator' => '=',- 'values' => [notification1.reason_ian.to_s, notification4.reason_ian.to_s]+ 'values' => [notification1.reason.to_s, notification4.reason.to_s]}}]@@ -229,7 +220,7 @@ describe ::API::V3::Notifications::NotificationsAPI,let(:responsible_notification) doFactoryBot.create :notification,recipient: recipient,- reason_ian: :responsible,+ reason: :responsible,resource: work_package,project: work_package.project,journal: work_package.journals.first@@ -263,7 +254,7 @@ describe ::API::V3::Notifications::NotificationsAPI,resource: work_package2,project: work_package2.project,recipient: recipient,- reason_ian: :responsible,+ reason: :responsible,journal: work_package2.journals.firstend