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 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, Issue.visible.scoped(:conditions => options[:conditions]).find :all, :include => ([:status, :project] + (options[:include] || [])).uniq,
:conditions => Query.merge_conditions(statement, options[:conditions]), :conditions => statement,
:order => order_option, :order => order_option,
:joins => joins, :joins => joins,
:limit => options[:limit], :limit => options[:limit],
@ -582,8 +582,7 @@ class Query < ActiveRecord::Base
# Returns the versions # Returns the versions
# Valid options are :conditions # Valid options are :conditions
def versions(options={}) def versions(options={})
Version.visible.find :all, :include => :project, Version.visible.scoped(:conditions => options[:conditions]).find :all, :include => :project, :conditions => project_statement
:conditions => Query.merge_conditions(project_statement, options[:conditions])
rescue ::ActiveRecord::StatementInvalid => e rescue ::ActiveRecord::StatementInvalid => e
raise StatementInvalid.new(e.message) raise StatementInvalid.new(e.message)
end end