summaryrefslogtreecommitdiffstats
path: root/app/models/query.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-23 19:00:54 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-23 19:00:54 +0000
commit3d23c42fc010e069bdbf447270c62ffb70dae8b4 (patch)
tree72b19df5e3a30337b9f78872ab10e79fdaf7f417 /app/models/query.rb
parent2081730f42d46170244d36a18d329fa6fd669dc1 (diff)
downloadredmine-3d23c42fc010e069bdbf447270c62ffb70dae8b4.tar.gz
redmine-3d23c42fc010e069bdbf447270c62ffb70dae8b4.zip
Do not use .merge_conditions.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7898 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/query.rb')
-rw-r--r--app/models/query.rb7
1 files 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