mirror of
https://github.com/internetee/registry.git
synced 2025-07-31 23:16:23 +02:00
replaced deprecated method (search)
This commit is contained in:
parent
e5e56b9de7
commit
f9f74fa3e3
20 changed files with 26 additions and 26 deletions
|
@ -26,14 +26,14 @@ class Registrar
|
|||
end
|
||||
|
||||
normalize_search_parameters do
|
||||
@q = domains.search(search_params.except(:contacts_ident_eq))
|
||||
@q = domains.ransack(search_params.except(:contacts_ident_eq))
|
||||
@domains = @q.result.page(params[:page])
|
||||
|
||||
# if we do not get any results, add wildcards to the name field and search again
|
||||
if @domains.count == 0 && search_params[:name_matches] !~ /^%.+%$/
|
||||
new_search_params = search_params.to_h.except(:contacts_ident_eq)
|
||||
new_search_params[:name_matches] = "%#{new_search_params[:name_matches]}%"
|
||||
@q = domains.search(new_search_params)
|
||||
@q = domains.ransack(new_search_params)
|
||||
@domains = @q.result.page(params[:page])
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue