From ed1320f3c94a28b22a289043643a06488e38e9fc Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 1 Jan 2012 18:23:45 +0000 Subject: [PATCH] Use #scoped instead of .with_scope git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8460 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../acts_as_searchable/lib/acts_as_searchable.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/vendor/plugins/acts_as_searchable/lib/acts_as_searchable.rb b/vendor/plugins/acts_as_searchable/lib/acts_as_searchable.rb index ed19dc736..1af226ae4 100644 --- a/vendor/plugins/acts_as_searchable/lib/acts_as_searchable.rb +++ b/vendor/plugins/acts_as_searchable/lib/acts_as_searchable.rb @@ -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