Fix symbolize_keys deprectation warning

DEPRECATION WARNING: Method symbolize_keys is deprecated and will be
removed in Rails 5.1, as `ActionController::Parameters` no longer
inherits from hash. Using this deprecated behavior exposes potential
security problems. If you continue to use this method you may be
creating a security vulnerability in your app that can be exploited.
Instead, consider using one of these documented methods which are not
deprecated:
http://api.rubyonrails.org/v5.0.4/classes/ActionController/Parameters.ht
ml (called from csv_params at
/home/travis/build/consul/consul/app/helpers/budgets_helper.rb:15)
This commit is contained in:
rgarcia
2018-04-08 14:37:39 +02:00
committed by Julian Herrero
parent 7ddbf5ff35
commit b62eff841c

View File

@@ -12,7 +12,8 @@ module BudgetsHelper
end end
def csv_params def csv_params
csv_params = params.clone.merge(format: :csv).symbolize_keys csv_params = params.clone.merge(format: :csv)
csv_params = csv_params.to_unsafe_h.map { |k, v| [k.to_sym, v] }.to_h
csv_params.delete(:page) csv_params.delete(:page)
csv_params csv_params
end end