From 3d23c42fc010e069bdbf447270c62ffb70dae8b4 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 23 Nov 2011 19:00:54 +0000 Subject: [PATCH] Do not use .merge_conditions. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7898 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/query.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/query.rb b/app/models/query.rb index a215ac4e4..a02cc810f 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -557,8 +557,8 @@ class Query < ActiveRecord::Base joins = (order_option && order_option.include?('authors')) ? "LEFT OUTER JOIN users authors ON authors.id = #{Issue.table_name}.author_id" : nil - Issue.visible.find :all, :include => ([:status, :project] + (options[:include] || [])).uniq, - :conditions => Query.merge_conditions(statement, options[:conditions]), + Issue.visible.scoped(:conditions => options[:conditions]).find :all, :include => ([:status, :project] + (options[:include] || [])).uniq, + :conditions => statement, :order => order_option, :joins => joins, :limit => options[:limit], @@ -582,8 +582,7 @@ class Query < ActiveRecord::Base # Returns the versions # Valid options are :conditions def versions(options={}) - Version.visible.find :all, :include => :project, - :conditions => Query.merge_conditions(project_statement, options[:conditions]) + Version.visible.scoped(:conditions => options[:conditions]).find :all, :include => :project, :conditions => project_statement rescue ::ActiveRecord::StatementInvalid => e raise StatementInvalid.new(e.message) end -- 2.39.5