From da895edf2e43d8c03089df7042a5bff7ef15fff0 Mon Sep 17 00:00:00 2001 From: Kir Shatrov Date: Thu, 29 Jun 2017 20:25:54 +0300 Subject: Fallback Parameters#to_s to Hash#to_s Fixes https://github.com/rails/rails/issues/29617 --- actionpack/lib/action_controller/metal/strong_parameters.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller/metal') diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb index cd6a0c0b98..3c16bde09c 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -179,6 +179,13 @@ module ActionController # # Returns a new array of the keys of the parameters. + ## + # :method: to_s + # + # :call-seq: + # to_s() + # Returns the content of the parameters as a string. + ## # :method: value? # @@ -195,7 +202,7 @@ module ActionController # # Returns a new array of the values of the parameters. delegate :keys, :key?, :has_key?, :values, :has_value?, :value?, :empty?, :include?, - :as_json, to: :@parameters + :as_json, :to_s, to: :@parameters # By default, never raise an UnpermittedParameters exception if these # params are present. The default includes both 'controller' and 'action' -- cgit v1.2.3