Oleg Kh wrote:> A small problem here. As per documentation on
> http://corelib.rubyonrails.org/classes/YAML.html YAML.load(string)
> should just return a hash. However on my windows machine it returns
> something like this:
>
> #<YAML::Syck::DomainType:0x36d5038
> @domain="yaml.org,2002",
> @type_id="map:HashWithIndifferentAccess",
> @value> {"key"=>"value",
> "key"=>"value",
> "key"=>"value",
> "key"=>"value",
> }>
>
> Obviously, on windows machine I have to do something like
> YAML.load(something).value[''key''] to get something. On
Linux box .value
> method will fail as we only get a simple hash there.
>
> Any idea what is goin on? A bug?
Now, I am seeing this problem, too, but in serializing.
Specifically, I have a field that''s serialized in my model. This works
fine going back and forth to a hash in Locomotive in development. But,
in production on DreamHost, the deseralization ends up like this:
!ruby/object:YAML::Syck::DomainType
domain: yaml.org,2002
type_id: map:HashWithIndifferentAccess
value:
key1: "value1"
key2: "value2"
Thus, of course, I can''t use the hash methods. And Rails then generates
errors like "undefined method `include?'' for
#<YAML::Syck::DomainType:0x407fb584>"
I''m using Rails 1.1.6, and so is DreamHost. Does anyone have any ideas
what''s going on?
-Paul
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---