aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorJoshua Wehner <joshua.wehner@gmail.com>2011-03-03 15:43:42 -0500
committerJoshua Wehner <joshua.wehner@gmail.com>2011-05-10 12:06:09 -0400
commit2cef2d411a20b89b71fb76876c33b331f94d0cc5 (patch)
treebe87688daa4b431f01e1e05051fa764408341bfc /activemodel/lib
parent8e55afb453beb8f98d647ae97619101b19b7f911 (diff)
downloadrails-2cef2d411a20b89b71fb76876c33b331f94d0cc5.tar.gz
rails-2cef2d411a20b89b71fb76876c33b331f94d0cc5.tar.bz2
rails-2cef2d411a20b89b71fb76876c33b331f94d0cc5.zip
Methods that return nil should not be considered YAML
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/serializers/xml.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/serializers/xml.rb b/activemodel/lib/active_model/serializers/xml.rb
index d4295e6afe..19639b1363 100644
--- a/activemodel/lib/active_model/serializers/xml.rb
+++ b/activemodel/lib/active_model/serializers/xml.rb
@@ -33,6 +33,7 @@ module ActiveModel
protected
def compute_type
+ return if value.nil?
type = ActiveSupport::XmlMini::TYPE_NAMES[value.class.name]
type ||= :string if value.respond_to?(:to_str)
type ||= :yaml