#720 ✓resolved
zhhz

0.9.8 breaks YAML.dump(actually breaks Array)

Reported by zhhz | December 18th, 2008 @ 11:39 AM

Steps for reproduce:

zooo = Zoo.all File.open('zoo.yaml', 'w'){|f| YAML.dump(zooo, f)}

Error message: undefined method []' for #<YAML::Syck::Emitter:0x23d52a0>

Above code works in 0.9.7

Comments and changes to this ticket

  • zhhz

    zhhz December 18th, 2008 @ 02:51 PM

    • Tag changed from 0.9.8, dump, yaml to 0.9.8, array, dump, yaml
    • Title changed from “0.9.8 breaks YAML.dump” to “0.9.8 breaks YAML.dump(actually breaks Array)”

    OK, I think my example is a little bit miss-leading. The fact is you can not do any operating on the Array:

    z1 = Zoo.all(:condition.....) z1.to_yaml # this OK

    z2 = Zoo.all(:condition...) z2.to_yaml # this OK

    z3 = z1 + z2 z3.to_yaml # bam!. ERROR

    I am hoping this is helpful.

  • zhhz

    zhhz December 18th, 2008 @ 02:53 PM

    the format is terrible.

  • zhhz

    zhhz December 18th, 2008 @ 02:56 PM

    Sorry for the spam, try to make the format working:

    
    # OK, I think my example is a little bit miss-leading. 
    # The fact is you can not do any operating on the Array:
    z1 = Zoo.all(:condition.....) 
    z1.to_yaml # this OK
    
    z2 = Zoo.all(:condition...) 
    z2.to_yaml # this OK
    
    z3 = z1 + z2 z3.to_yaml # bam!. ERROR
    
    # I am hoping this is helpful.
    
  • zhhz

    zhhz December 18th, 2008 @ 02:57 PM

    I promise, this will be the last update, :-)

    
    # OK, I think my example is a little bit miss-leading. 
    # The fact is you can not do any operating on the Array:
    z1 = Zoo.all(:condition.....) 
    z1.to_yaml # this OK
    
    z2 = Zoo.all(:condition...) 
    z2.to_yaml # this OK
    
    z3 = z1 + z2 
    z3.to_yaml # bam!. ERROR
    
    # I am hoping this is helpful.
    
  • Xavier Shay

    Xavier Shay December 31st, 2008 @ 01:35 PM

    • Tag changed from 0.9.8, array, dump, yaml to 0.9.8, array, dm-serializer, dump, yaml
    • State changed from “unconfirmed” to “accepted”
    • Assigned user set to “Xavier Shay”

    I will investigate

  • Xavier Shay

    Xavier Shay January 3rd, 2009 @ 12:19 PM

    • State changed from “accepted” to “resolved”

    http://github.com/dkubb/dm-more/...

    Please note from the README: dm-serializer only adds serialization methods to DataMapper objects and collections, however some libraries used (json, yaml) add methods to core classes, such as Array. Note that passing dm-serializer options (such as :only) to these methods is not supported.

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.

New-ticket Create new ticket

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

Pages