From fbf99653f14273773e4437390ecdca736f495fb9 Mon Sep 17 00:00:00 2001 From: Jim Herzberg Date: Wed, 18 May 2011 15:52:55 -0400 Subject: Attributes with :string type should not be given the type passed in model serialization options. Closes #1058 --- activemodel/lib/active_model/serializers/xml.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activemodel/lib') diff --git a/activemodel/lib/active_model/serializers/xml.rb b/activemodel/lib/active_model/serializers/xml.rb index 19639b1363..eb3975f86b 100644 --- a/activemodel/lib/active_model/serializers/xml.rb +++ b/activemodel/lib/active_model/serializers/xml.rb @@ -25,7 +25,7 @@ module ActiveModel def decorations decorations = {} decorations[:encoding] = 'base64' if type == :binary - decorations[:type] = type unless type == :string + decorations[:type] = (type == :string) ? nil : type decorations[:nil] = true if value.nil? decorations end -- cgit v1.2.3