From 0f2a9681a318e5d27ef4e45195f2ac4b75f351dc Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Thu, 4 May 2017 18:52:01 +0300 Subject: [Multiple issue assignees] Resolving conflicts --- app/models/issue_assignee.rb | 16 ---------------- app/models/user.rb | 1 - app/services/notification_service.rb | 4 +++- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/app/models/issue_assignee.rb b/app/models/issue_assignee.rb index b94b55bb1d1..0663d3aaef8 100644 --- a/app/models/issue_assignee.rb +++ b/app/models/issue_assignee.rb @@ -7,23 +7,7 @@ class IssueAssignee < ActiveRecord::Base after_create :update_assignee_cache_counts after_destroy :update_assignee_cache_counts - # EE-specific - after_create :update_elasticsearch_index - after_destroy :update_elasticsearch_index - # EE-specific - def update_assignee_cache_counts assignee&.update_cache_counts end - - def update_elasticsearch_index - if current_application_settings.elasticsearch_indexing? - ElasticIndexerWorker.perform_async( - :update, - 'Issue', - issue.id, - changed_fields: ['assignee_ids'] - ) - end - end end diff --git a/app/models/user.rb b/app/models/user.rb index a3126cbb644..6015643b565 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -89,7 +89,6 @@ class User < ActiveRecord::Base has_many :subscriptions, dependent: :destroy has_many :recent_events, -> { order "id DESC" }, foreign_key: :author_id, class_name: "Event" has_many :oauth_applications, class_name: 'Doorkeeper::Application', as: :owner, dependent: :destroy - has_one :abuse_report, dependent: :destroy, foreign_key: :user_id has_many :reported_abuse_reports, dependent: :destroy, foreign_key: :reporter_id, class_name: "AbuseReport" has_many :spam_logs, dependent: :destroy diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index fe9f5ae2b33..c65c66d7150 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -74,12 +74,14 @@ class NotificationService previous_assignee: previous_assignees ) + previous_assignee_ids = previous_assignees.map(&:id) + recipients.each do |recipient| mailer.send( :reassigned_issue_email, recipient.id, issue.id, - previous_assignees.map(&:id), + previous_assignee_ids, current_user.id ).deliver_later end -- cgit v1.2.1