From 917281770f2dc0865fd5e6af0bb738f9be4d1217 Mon Sep 17 00:00:00 2001 From: Thomas Leishman Date: Wed, 22 Mar 2017 22:58:19 -0600 Subject: [PATCH] correct scope in Digest#get_created_issue_ids --- lib/redmine_digest/digest.rb | 2 +- test/unit/redmine_digest/digest_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/redmine_digest/digest.rb b/lib/redmine_digest/digest.rb index cbac8ce..5752bd6 100644 --- a/lib/redmine_digest/digest.rb +++ b/lib/redmine_digest/digest.rb @@ -180,7 +180,7 @@ def get_changed_issue_ids def get_created_issue_ids issues = Issue.where('issues.project_id in (?)', project_ids). where('issues.created_on >= ? and issues.created_on < ?', time_from, time_to) - issues.where('(issues.assigned_to_id = ? OR issues.author_id = ?)', user.id, user.id) if all_involved_only? + issues = issues.where('(issues.assigned_to_id = ? OR issues.author_id = ?)', user.id, user.id) if all_involved_only? issues.uniq.pluck(:id) end diff --git a/test/unit/redmine_digest/digest_test.rb b/test/unit/redmine_digest/digest_test.rb index 1ee0b3a..5271c53 100644 --- a/test/unit/redmine_digest/digest_test.rb +++ b/test/unit/redmine_digest/digest_test.rb @@ -136,7 +136,7 @@ def test_all_involved ) time_to = Journal.last.created_on + 1.hour digest = RedmineDigest::Digest.new(rule, time_to) - exp_ids = [1, 2, 4, 6, 7, 8, 11, 12, 14] + exp_ids = [1, 2, 4, 6, 7, 8, 11, 14] issue_ids = digest.issues.map(&:id).sort assert_equal exp_ids, issue_ids end