
model instance conversion to_yaml broken
Reported by Stephen Bannasch | October 12th, 2007 @ 05:49 PM
model_instance.to_yaml doesn't work.
PATCH with test attached -- sorry no fix.
Testing the example models and fixture from in a svn co r312
irb(main):005:0> Zoo.find(1).to_yaml
TypeError: can't dump anonymous class Class
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:6:in to_yaml'
from
/usr/local/lib/ruby/1.8/yaml/rubytypes.rb:41:in
node_export'
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:41:in add'
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:41:in
to_yaml'
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:40:in each'
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:40:in
to_yaml'
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:39:in map'
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:39:in
to_yaml'
from /usr/local/lib/ruby/1.8/yaml.rb:387:in call' from
/usr/local/lib/ruby/1.8/yaml.rb:387:in
emit' from
/usr/local/lib/ruby/1.8/yaml.rb:387:in quick_emit' from
/usr/local/lib/ruby/1.8/yaml/rubytypes.rb:38:in
to_yaml' from
/usr/local/lib/ruby/1.8/yaml/rubytypes.rb:18:in node_export'
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:18:in
add'
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:18:in to_yaml'
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:17:in
each'
... 25 levels... from /usr/local/lib/ruby/1.8/yaml.rb:387:in
call' from /usr/local/lib/ruby/1.8/yaml.rb:387:in
emit'
from /usr/local/lib/ruby/1.8/yaml.rb:387:in quick_emit' from
/usr/local/lib/ruby/1.8/yaml/rubytypes.rb:15:in
to_yaml' from
/usr/local/lib/ruby/1.8/yaml/rubytypes.rb:18:in node_export'
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:18:in
add'
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:18:in to_yaml'
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:17:in
each'
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:17:in to_yaml'
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:16:in
map'
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:16:in to_yaml'
from /usr/local/lib/ruby/1.8/yaml.rb:387:in
call' from
/usr/local/lib/ruby/1.8/yaml.rb:387:in emit' from
/usr/local/lib/ruby/1.8/yaml.rb:387:in
quick_emit' from
/usr/local/lib/ruby/1.8/yaml/rubytypes.rb:15:in `to_yaml' from
(irb):5irb(main):006:0> Zoo.find(1).to_s
Comments and changes to this ticket
-
-
Sam Smoot October 19th, 2007 @ 04:47 PM
The spec will need to be tweaked to check for the presence of keys. As opposed to the exact order since Hash order isn't gauranteed.
-
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
- Nobody is watching this ticket.