From ea5aa2525b4fbc7d8323a7e4c3ee98db2ee5acb4 Mon Sep 17 00:00:00 2001 From: Sid Ngeth Date: Fri, 17 Feb 2017 17:03:09 -0500 Subject: Wrap store accessors in parameters Modified params wrapper to account for model's stored_attributes --- actionpack/lib/action_controller/metal/params_wrapper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/metal/params_wrapper.rb b/actionpack/lib/action_controller/metal/params_wrapper.rb index 3cca5e8906..a89fc1678b 100644 --- a/actionpack/lib/action_controller/metal/params_wrapper.rb +++ b/actionpack/lib/action_controller/metal/params_wrapper.rb @@ -105,7 +105,11 @@ module ActionController unless super || exclude if m.respond_to?(:attribute_names) && m.attribute_names.any? - self.include = m.attribute_names + if m.respond_to?(:stored_attributes) && !m.stored_attributes.empty? + self.include = m.attribute_names + m.stored_attributes.values.flatten.map(&:to_s) + else + self.include = m.attribute_names + end end end end -- cgit v1.2.3