summaryrefslogtreecommitdiffstats
path: root/app/models/query.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/query.rb')
-rw-r--r--app/models/query.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/models/query.rb b/app/models/query.rb
index a4c9a53ed..381d18745 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -168,10 +168,8 @@ class Query < ActiveRecord::Base
user = args.shift || User.current
base = Project.allowed_to_condition(user, :view_issues, *args)
user_id = user.logged? ? user.id : 0
- {
- :conditions => ["(#{table_name}.project_id IS NULL OR (#{base})) AND (#{table_name}.is_public = ? OR #{table_name}.user_id = ?)", true, user_id],
- :include => :project
- }
+
+ includes(:project).where("(#{table_name}.project_id IS NULL OR (#{base})) AND (#{table_name}.is_public = ? OR #{table_name}.user_id = ?)", true, user_id)
}
def initialize(attributes=nil, *args)