Hi coco, > Hi everybody..I'm trying follow the book "clone internet application > with ruby" but I get many errors when I try run it...in the twitter > clone example this is my code:
... > I know Datamappers has been many changes but I don't know what code is > still valid yet and which has changed....if anybody can help me thanks The book covers a 0.9 version of DataMapper which is over a couple of years old, so it's quite possible that it's out of date. The first thing I noticed is that the class name is Relationship, and you have "has n, :relationships" both of those are reserved words inside the DM API, and I can't guarantee how they'll work with DM. If you're doing a standard many-to-many friendship relationship, I'd suggest looking RipTheJacker's dm-is-friendly: https://github.com/RipTheJacker/dm-is-friendly The other thing I should mention is that :child_key and :parent_key have no effect on many-to-many relationship. I've been meaning to raise an exception when you use those in m:m relationships, but I haven't had a chance to add it yet. The only way to control the join keys in a m:m relationship is making sure the one-to-many relationship you're piggy-backing over uses the correct keys to join, and you specify a :via to say which relationship you want to use in the intermediary to connect to the end-point. -- Dan (dkubb) -- You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.
