Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
Remove yaml coercion from the XML parser
Browse files Browse the repository at this point in the history
  • Loading branch information
dkubb committed Jan 8, 2013
1 parent b4f9817 commit 633974b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion lib/extlib/hash.rb
Expand Up @@ -284,7 +284,6 @@ class REXMLUtilityNode
self.typecasts["float"] = lambda{|v| v.nil? ? nil : v.to_f}
self.typecasts["symbol"] = lambda{|v| v.to_sym}
self.typecasts["string"] = lambda{|v| v.to_s}
self.typecasts["yaml"] = lambda{|v| v.nil? ? nil : YAML.load(v)}
self.typecasts["base64Binary"] = lambda{|v| v.unpack('m').first }

self.available_typecasts = self.typecasts.keys
Expand Down
4 changes: 2 additions & 2 deletions spec/hash_spec.rb
Expand Up @@ -254,7 +254,7 @@
'approved' => nil,
'written_on' => nil,
'viewed_at' => nil,
'content' => nil,
'content' => { 'type' => 'yaml' },
'parent_id' => nil
}
Hash.from_xml(topic_xml)["topic"].should == expected_topic_hash
Expand Down Expand Up @@ -292,7 +292,7 @@
# Changed this line where the key is :message. The yaml specifies this as a symbol, and who am I to change what you specify
# The line in ActiveSupport is
# 'content' => { 'message' => "Have a nice day", 1 => "should be an integer", "array" => [{ "should-have-dashes" => true, "should_have_underscores" => true }] },
'content' => { :message => "Have a nice day", 1 => "should be an integer", "array" => [{ "should-have-dashes" => true, "should_have_underscores" => true }] },
'content' => "--- \n1: should be an integer\n:message: Have a nice day\narray: \n- should-have-dashes: true\n should_have_underscores: true\n",
'author_email_address' => "david@loudthinking.com",
'parent_id' => nil,
'ad_revenue' => BigDecimal("1.50"),
Expand Down

0 comments on commit 633974b

Please sign in to comment.