aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal/params_wrapper.rb
diff options
context:
space:
mode:
authorSid Ngeth <sngeth@gmail.com>2017-02-17 17:03:09 -0500
committerSid Ngeth <sngeth@gmail.com>2017-03-21 15:47:29 -0400
commitea5aa2525b4fbc7d8323a7e4c3ee98db2ee5acb4 (patch)
tree84a9ad474e5e2518d7b7e89a81470988f2007501 /actionpack/lib/action_controller/metal/params_wrapper.rb
parent843345cae59b73e50af685ac1303a419a06b4c91 (diff)
downloadrails-ea5aa2525b4fbc7d8323a7e4c3ee98db2ee5acb4.tar.gz
rails-ea5aa2525b4fbc7d8323a7e4c3ee98db2ee5acb4.tar.bz2
rails-ea5aa2525b4fbc7d8323a7e4c3ee98db2ee5acb4.zip
Wrap store accessors in parameters
Modified params wrapper to account for model's stored_attributes
Diffstat (limited to 'actionpack/lib/action_controller/metal/params_wrapper.rb')
-rw-r--r--actionpack/lib/action_controller/metal/params_wrapper.rb6
1 files changed, 5 insertions, 1 deletions
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