aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorRyan Perez <rrperez@stanford.edu>2015-03-08 01:36:29 +0000
committerRafael Mendonça França <rafaelmfranca@gmail.com>2017-10-25 13:16:32 -0400
commit7b51b140d5da80402a114c06f30fbf66e12c676e (patch)
treeb4afd8204fe871dd7e6fb060e23c683047154aca /actionpack
parent08df10a95b4a72128ff5e5cee858c29c149e22a7 (diff)
downloadrails-7b51b140d5da80402a114c06f30fbf66e12c676e.tar.gz
rails-7b51b140d5da80402a114c06f30fbf66e12c676e.tar.bz2
rails-7b51b140d5da80402a114c06f30fbf66e12c676e.zip
Fixed functionality to include method in params_wrapper.rb
to properly wrap all attributes, including those which are nested.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/metal/params_wrapper.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/metal/params_wrapper.rb b/actionpack/lib/action_controller/metal/params_wrapper.rb
index f4f2381286..9f79d796cc 100644
--- a/actionpack/lib/action_controller/metal/params_wrapper.rb
+++ b/actionpack/lib/action_controller/metal/params_wrapper.rb
@@ -113,6 +113,13 @@ module ActionController
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
+ end
+ self.include += nested_attributes_names
+ end
+
end
end
end