diff --git a/actionpack/lib/action_controller/metal/params_wrapper.rb b/actionpack/lib/action_controller/metal/params_wrapper.rb index 3230c6d1b7..0234f138e8 100644 --- a/actionpack/lib/action_controller/metal/params_wrapper.rb +++ b/actionpack/lib/action_controller/metal/params_wrapper.rb @@ -75,7 +75,11 @@ module ActionController Options = Struct.new(:name, :format, :include, :exclude) do # :nodoc: def self.from_hash(hash) - new(*hash.values_at(:name, :format, :include, :exclude)) + name = hash[:name] + format = Array(hash[:format]) + include = hash[:include] && Array(hash[:include]).collect(&:to_s) + exclude = hash[:exclude] && Array(hash[:exclude]).collect(&:to_s) + new name, format, include, exclude end end @@ -187,10 +191,6 @@ module ActionController controller_name.singularize end - opts.format = Array(opts.format) - opts.include &&= Array(opts.include).collect(&:to_s) - opts.exclude &&= Array(opts.exclude).collect(&:to_s) - self._wrapper_options = opts end end