summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-04-25 07:33:28 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-04-25 07:33:28 +0000
commitd60a78fe2307d2e7a026c7c52471e0cdd7c757e3 (patch)
treed36725d653f3b4dc78a875fadbebf969307d9fd5
parent97939f8829b42e7dace7fce1533e457456147fb6 (diff)
downloadredmine-d60a78fe2307d2e7a026c7c52471e0cdd7c757e3.tar.gz
redmine-d60a78fe2307d2e7a026c7c52471e0cdd7c757e3.zip
Merged r14163 (#19168).
git-svn-id: http://svn.redmine.org/redmine/branches/3.0-stable@14204 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/journal.rb2
-rw-r--r--test/unit/activity_test.rb8
2 files changed, 9 insertions, 1 deletions
diff --git a/app/models/journal.rb b/app/models/journal.rb
index c20aa8d9d..ec9c9d52e 100644
--- a/app/models/journal.rb
+++ b/app/models/journal.rb
@@ -38,7 +38,7 @@ class Journal < ActiveRecord::Base
:scope => preload({:issue => :project}, :user).
joins("LEFT OUTER JOIN #{JournalDetail.table_name} ON #{JournalDetail.table_name}.journal_id = #{Journal.table_name}.id").
where("#{Journal.table_name}.journalized_type = 'Issue' AND" +
- " (#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> '')")
+ " (#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> '')").uniq
before_create :split_private_notes
after_create :send_notification
diff --git a/test/unit/activity_test.rb b/test/unit/activity_test.rb
index afb5a111c..5df2699b6 100644
--- a/test/unit/activity_test.rb
+++ b/test/unit/activity_test.rb
@@ -76,6 +76,14 @@ class ActivityTest < ActiveSupport::TestCase
assert_nil(events.detect {|e| e.event_author != user})
end
+ def test_journal_with_notes_and_changes_should_be_returned_once
+ f = Redmine::Activity::Fetcher.new(User.anonymous, :project => Project.find(1))
+ f.scope = ['issues']
+ events = f.events
+
+ assert_equal events, events.uniq
+ end
+
def test_files_activity
f = Redmine::Activity::Fetcher.new(User.anonymous, :project => Project.find(1))
f.scope = ['files']