Use #scoped instead of .with_scope

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8460 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-01-01 18:23:45 +00:00
parent 1f6764e2af
commit ed1320f3c9
1 changed files with 5 additions and 7 deletions

View File

@ -119,13 +119,11 @@ module Redmine
results = []
results_count = 0
with_scope(:find => {:conditions => project_conditions}) do
with_scope(:find => find_options) do
results_count = scope.count(:all)
results = scope.find(:all, limit_options)
end
end
scope = scope.scoped({:conditions => project_conditions}).scoped(find_options)
results_count = scope.count(:all)
results = scope.find(:all, limit_options)
[results, results_count]
end
end