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