From 4254148986fbb7714dd7b10a1ddbebbb2832428c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 15 Oct 2017 16:43:19 +0000 Subject: [PATCH] Editing issues no longer sends notifications to previous assignee (#26627). git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@17002 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/issue.rb | 2 -- test/unit/issue_test.rb | 7 ++----- test/unit/user_test.rb | 4 ---- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index 33e6bf223..62a02e878 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -116,8 +116,6 @@ class Issue < ActiveRecord::Base after_save :after_create_from_copy after_destroy :update_parent_attributes after_create :send_notification - # Keep it at the end of after_save callbacks - after_save :clear_assigned_to_was # Returns a SQL conditions string used to find all issues visible by the specified user def self.visible_condition(user, options={}) diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index 2902c427f..ca038c877 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -1883,8 +1883,6 @@ class IssueTest < ActiveSupport::TestCase issue = Issue.find(2) issue.assigned_to = nil assert_include user.mail, issue.recipients - issue.save! - assert !issue.recipients.include?(user.mail) end def test_recipients_should_not_include_users_that_cannot_view_the_issue @@ -2443,9 +2441,8 @@ class IssueTest < ActiveSupport::TestCase def test_update_should_notify_previous_assignee ActionMailer::Base.deliveries.clear - user = User.find(3) - user.members.update_all ["mail_notification = ?", false] - user.update! :mail_notification => 'only_assigned' + user = User.generate!(:mail_notification => 'only_assigned') + Issue.where(:id => 2).update_all(:assigned_to_id => user.id) with_settings :notified_events => %w(issue_updated) do issue = Issue.find(2) diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb index 858dc3209..d983eab86 100644 --- a/test/unit/user_test.rb +++ b/test/unit/user_test.rb @@ -1196,10 +1196,6 @@ class UserTest < ActiveSupport::TestCase issue.assigned_to = new_assignee assert assignee.notify_about?(issue) assert new_assignee.notify_about?(issue) - - issue.save! - assert !assignee.notify_about?(issue) - assert new_assignee.notify_about?(issue) end def test_notify_about_news -- 2.39.5