Open solnic opened 13 years ago
Its because #belongs_to and #has are class methods, so when you do belongs_to :my_obj your calling that on that particular module.
Should remixable define its own belongs_to and has that it calls on anything that remixes it?
by coryodaniel
I think I have a better idea: I have a class called deferred module that allows you use any class methods on hosting class since body of module is evaluated only on inclusion. I will port it to Extlib shortly.
by Michael Klishin (antares)
I will start working on a "new" dm-is-remixable pretty soon. Ted Han and I both want to make the API more "has" like, and will definitely have a look at incorporating extlib/lazy_module to allow for association definitions right inside the remixable module.
by Martin Gamsjaeger (snusnu)
In the meantime I’ve started work on my dm-is-remixable implementation but I got sidetracked and so things currently aren’t totally useable atm. I’m marking this as a suggestion for now to remind me that the new version should support this, but to not stand in the way of open tickets. I don’t think that feature request will ever make it into the current implementation of dm-is-remixable (unless someone else is willing to provide it).
by Martin Gamsjaeger (snusnu)
dm-is-remixable does not allow belong_to relations (and I guess, but haven't tested, neither has-1/n relations). Is that by design?
Workaround is to use enhance at the places where you remix the remixable, but that is quite repetitive.
Created by Lawrence Pit - 2008-10-24 11:36:07 UTC
Original Lighthouse ticket: http://datamapper.lighthouseapp.com/projects/20609/tickets/612