aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/serializers
diff options
context:
space:
mode:
authorAnthony <alberto.anthony@gmail.com>2012-07-27 15:13:05 -0400
committerAnthony Alberto <alberto.anthony@gmail.com>2012-08-13 19:14:24 -0700
commit78f5874c82ed50d405cbe1ae9a9e75b7b2ae8ef5 (patch)
tree00b6bbfd47d4ded0fa16544cf736bffe727a8336 /activemodel/lib/active_model/serializers
parent2d9dbf416b14610cc21fc10e68700c3a7ffc32a3 (diff)
downloadrails-78f5874c82ed50d405cbe1ae9a9e75b7b2ae8ef5.tar.gz
rails-78f5874c82ed50d405cbe1ae9a9e75b7b2ae8ef5.tar.bz2
rails-78f5874c82ed50d405cbe1ae9a9e75b7b2ae8ef5.zip
Following the false issue reporting I did here : https://github.com/rails/rails/issues/6958
- Enable propagation of :skip_types, :dasherize and :camelize on included models by default - Adding the option to override this propagation on a per-include basis (:include => { :model => { :dasherize => false } } - Enough tests to prove it works - Updated activemodel CHANGELOG.md Squashed my commits
Diffstat (limited to 'activemodel/lib/active_model/serializers')
-rwxr-xr-x[-rw-r--r--]activemodel/lib/active_model/serializers/xml.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/serializers/xml.rb b/activemodel/lib/active_model/serializers/xml.rb
index 016d821fdf..cf742d0569 100644..100755
--- a/activemodel/lib/active_model/serializers/xml.rb
+++ b/activemodel/lib/active_model/serializers/xml.rb
@@ -115,6 +115,10 @@ module ActiveModel
merged_options = opts.merge(options.slice(:builder, :indent))
merged_options[:skip_instruct] = true
+ [:skip_types, :dasherize, :camelize].each do |key|
+ merged_options[key] = options[key] if merged_options[key].nil? && !options[key].nil?
+ end
+
if records.respond_to?(:to_ary)
records = records.to_ary