diff options
author | Kelton Manzanares <keltonmanzanares@gmail.com> | 2017-10-20 19:07:14 -0600 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-10-25 13:16:33 -0400 |
commit | dd423a743e9d47aaa3d15e4f7dc0fc64157cd55c (patch) | |
tree | 6caf2da47c1b5faacf92d1fecec839cefed480e4 /actionpack/lib | |
parent | 7b51b140d5da80402a114c06f30fbf66e12c676e (diff) | |
download | rails-dd423a743e9d47aaa3d15e4f7dc0fc64157cd55c.tar.gz rails-dd423a743e9d47aaa3d15e4f7dc0fc64157cd55c.tar.bz2 rails-dd423a743e9d47aaa3d15e4f7dc0fc64157cd55c.zip |
checking for nested attributes when attribute names specified to wrap them as well
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/metal/params_wrapper.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/metal/params_wrapper.rb b/actionpack/lib/action_controller/metal/params_wrapper.rb index 9f79d796cc..a678377d4f 100644 --- a/actionpack/lib/action_controller/metal/params_wrapper.rb +++ b/actionpack/lib/action_controller/metal/params_wrapper.rb @@ -112,14 +112,15 @@ module ActionController else self.include = m.attribute_names end - end - if m.respond_to?(:nested_attributes_options) && m.nested_attributes_options.any? - nested_attributes_names = self.nested_attributes_options.keys.map do |key| - key.to_s.concat('_attributes').to_sym + + if m.respond_to?(:nested_attributes_options) && m.nested_attributes_options.keys.any? + self.include += m.nested_attributes_options.keys.map do |key| + key.to_s.concat("_attributes") + end end - self.include += nested_attributes_names - end + self.include + end end end end |