Upgrade to Rails 5.0

Closes #377
This commit is contained in:
Artur Beljajev 2019-09-15 15:38:52 +03:00
parent bb108efedd
commit fa52001be6
141 changed files with 1388 additions and 1664 deletions

View file

@ -3,6 +3,7 @@ module Admin
load_and_authorize_resource
before_action :set_contact, only: [:show]
helper_method :ident_types
helper_method :domain_filter_params
def index
params[:q] ||= {}
@ -19,7 +20,7 @@ module Admin
normalize_search_parameters do
@q = contacts.search(search_params)
@contacts = @q.result.uniq.page(params[:page])
@contacts = @q.result.distinct.page(params[:page])
end
@contacts = @contacts.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
@ -84,5 +85,9 @@ module Admin
def ident_types
Contact::Ident.types
end
def domain_filter_params
params.permit(:domain_filter)
end
end
end