##// END OF EJS Templates
Fixed that journals are shown multiple times in activity (#19168)....
Jean-Philippe Lang -
r13781:cb9d405db3ba
parent child
Show More
@@ -38,7 +38,7 class Journal < ActiveRecord::Base
38 :scope => preload({:issue => :project}, :user).
38 :scope => preload({:issue => :project}, :user).
39 joins("LEFT OUTER JOIN #{JournalDetail.table_name} ON #{JournalDetail.table_name}.journal_id = #{Journal.table_name}.id").
39 joins("LEFT OUTER JOIN #{JournalDetail.table_name} ON #{JournalDetail.table_name}.journal_id = #{Journal.table_name}.id").
40 where("#{Journal.table_name}.journalized_type = 'Issue' AND" +
40 where("#{Journal.table_name}.journalized_type = 'Issue' AND" +
41 " (#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> '')")
41 " (#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> '')").uniq
42
42
43 before_create :split_private_notes
43 before_create :split_private_notes
44 after_create :send_notification
44 after_create :send_notification
@@ -76,6 +76,14 class ActivityTest < ActiveSupport::TestCase
76 assert_nil(events.detect {|e| e.event_author != user})
76 assert_nil(events.detect {|e| e.event_author != user})
77 end
77 end
78
78
79 def test_journal_with_notes_and_changes_should_be_returned_once
80 f = Redmine::Activity::Fetcher.new(User.anonymous, :project => Project.find(1))
81 f.scope = ['issues']
82 events = f.events
83
84 assert_equal events, events.uniq
85 end
86
79 def test_files_activity
87 def test_files_activity
80 f = Redmine::Activity::Fetcher.new(User.anonymous, :project => Project.find(1))
88 f = Redmine::Activity::Fetcher.new(User.anonymous, :project => Project.find(1))
81 f.scope = ['files']
89 f.scope = ['files']
General Comments 0
You need to be logged in to leave comments. Login now