Do not use .merge_conditions.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7898 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-11-23 19:00:54 +00:00
parent 2081730f42
commit 3d23c42fc0
1 changed files with 3 additions and 4 deletions

View File

@ -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