diff --git a/app/notifications/recipients/repository_item_recipients.rb b/app/notifications/recipients/repository_item_recipients.rb new file mode 100644 index 000000000..bf1f0ad85 --- /dev/null +++ b/app/notifications/recipients/repository_item_recipients.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class Recipients::RepositoryItemRecipients + def initialize(params) + @repository_row_id = params[:repository_row_id] + end + + def recipients + repository_row = RepositoryRow.find(@repository_row_id) + repository_row.repository.team.users + end +end diff --git a/app/notifications/recipients/repository_row_creator.rb b/app/notifications/recipients/repository_row_creator.rb deleted file mode 100644 index aa02c54d1..000000000 --- a/app/notifications/recipients/repository_row_creator.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class Recipients::RepositoryRowCreator - def initialize(params) - @params = params - end - - def recipients - [RepositoryRow.find(@params[:repository_row_id]).created_by] - end -end diff --git a/config/initializers/extends/notification_extends.rb b/config/initializers/extends/notification_extends.rb index ed32a0bc9..8a793c1e2 100644 --- a/config/initializers/extends/notification_extends.rb +++ b/config/initializers/extends/notification_extends.rb @@ -78,10 +78,10 @@ class NotificationExtends recipients_module: :AssignedRecipients }, item_low_stock_reminder: { - recipients_module: :RepositoryRowCreator + recipients_module: :RepositoryItemRecipients }, item_date_reminder: { - recipients_module: :RepositoryRowCreator + recipients_module: :RepositoryItemRecipients }, smart_annotation_added: { recipients_module: :DirectRecipient