From: Jean-Philippe Lang Date: Sun, 1 Jan 2012 18:23:45 +0000 (+0000) Subject: Use #scoped instead of .with_scope X-Git-Tag: 1.4.0~828 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ed1320f3c94a28b22a289043643a06488e38e9fc;p=redmine.git Use #scoped instead of .with_scope git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8460 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- 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