]> source.dussan.org Git - redmine.git/commitdiff
Use #scoped instead of .with_scope
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 1 Jan 2012 18:23:45 +0000 (18:23 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 1 Jan 2012 18:23:45 +0000 (18:23 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8460 e93f8b46-1217-0410-a6f0-8f06a7374b81

vendor/plugins/acts_as_searchable/lib/acts_as_searchable.rb

index ed19dc736472d7e9c1a55ac207cf72777b380e8d..1af226ae47a33b3c31b35c29187ec331ec60a961 100644 (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