##// END OF EJS Templates
Missing notification if previous assignee was a group (#19197)....
Jean-Philippe Lang -
r13667:3789a8539e39
parent child
Show More
@@ -830,12 +830,12 class Issue < ActiveRecord::Base
830 end
830 end
831 end
831 end
832
832
833 # Returns the previous assignee if changed
833 # Returns the previous assignee (user or group) if changed
834 def assigned_to_was
834 def assigned_to_was
835 # assigned_to_id_was is reset before after_save callbacks
835 # assigned_to_id_was is reset before after_save callbacks
836 user_id = @previous_assigned_to_id || assigned_to_id_was
836 user_id = @previous_assigned_to_id || assigned_to_id_was
837 if user_id && user_id != assigned_to_id
837 if user_id && user_id != assigned_to_id
838 @assigned_to_was ||= User.find_by_id(user_id)
838 @assigned_to_was ||= Principal.find_by_id(user_id)
839 end
839 end
840 end
840 end
841
841
@@ -2614,4 +2614,12 class IssueTest < ActiveSupport::TestCase
2614 issue.tracker = Tracker.find(2)
2614 issue.tracker = Tracker.find(2)
2615 assert_equal IssueStatus.find(3), issue.status
2615 assert_equal IssueStatus.find(3), issue.status
2616 end
2616 end
2617
2618 def test_assigned_to_was_with_a_group
2619 group = Group.find(10)
2620
2621 issue = Issue.generate!(:assigned_to => group)
2622 issue.reload.assigned_to = nil
2623 assert_equal group, issue.assigned_to_was
2624 end
2617 end
2625 end
General Comments 0
You need to be logged in to leave comments. Login now