]> source.dussan.org Git - redmine.git/commitdiff
use includes instead of joins at Issue#visible
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 24 Oct 2014 02:18:28 +0000 (02:18 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 24 Oct 2014 02:18:28 +0000 (02:18 +0000)
"rake test" passes all test, but following test fails on command line.

<pre>
$ ruby test/unit/issue_test.rb -n test_visible_scope_for_member_with_groups_should_return_assigned_issues

  1) Failure:
IssueTest#test_visible_scope_for_member_with_groups_should_return_assigned_issues [test/unit/issue_test.rb:321]:
Failed assertion, no message given.
</pre>

git-svn-id: http://svn.redmine.org/redmine/trunk@13500 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb

index 34a49be0d9c1b9023f6f3a730f5f48a64631d5f0..d50d755d4f6539dbc58938bf1713d69d0b2b6541 100644 (file)
@@ -77,7 +77,7 @@ class Issue < ActiveRecord::Base
   attr_protected :id
 
   scope :visible, lambda {|*args|
-    joins(:project).
+    includes(:project).
     references(:project).
     where(Issue.visible_condition(args.shift || User.current, *args))
   }