[#330] small refactoring

This commit is contained in:
Alexander Machehin 2014-09-30 21:10:06 +06:00
parent 89f322cd24
commit 2bca1f441c
1 changed files with 8 additions and 7 deletions

View File

@ -16,11 +16,12 @@ class Search
protected protected
def find_collection(type, term, ability, paginate_params) def find_collection(type, term, ability, paginate_params)
if type == 'users' scope = if type == 'users'
User.opened User.opened
else else
type.classify.constantize.accessible_by(ability, :read) type.classify.constantize.accessible_by(ability, :read)
end.search(term). end
scope.search(term).
search_order. search_order.
paginate(paginate_params) paginate(paginate_params)
end end