mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 05:34:46 +02:00
replaced deprecated method (search)
This commit is contained in:
parent
e5e56b9de7
commit
f9f74fa3e3
20 changed files with 26 additions and 26 deletions
|
@ -14,7 +14,7 @@ module Admin
|
|||
end
|
||||
|
||||
normalize_search_parameters do
|
||||
@q = domains.search(params[:q])
|
||||
@q = domains.ransack(params[:q])
|
||||
@domains = @q.result.page(params[:page])
|
||||
if @domains.count == 1 && params[:q][:name_matches].present?
|
||||
redirect_to [:admin, @domains.first] and return
|
||||
|
@ -22,7 +22,7 @@ module Admin
|
|||
# if we do not get any results, add wildcards to the name field and search again
|
||||
n_cache = params[:q][:name_matches]
|
||||
params[:q][:name_matches] = "%#{params[:q][:name_matches]}%"
|
||||
@q = domains.search(params[:q])
|
||||
@q = domains.ransack(params[:q])
|
||||
@domains = @q.result.page(params[:page])
|
||||
params[:q][:name_matches] = n_cache # we don't want to show wildcards in search form
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue