Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

dm-is-remixable: allow belongs_to #12

Open
solnic opened this issue May 17, 2011 · 4 comments
Open

dm-is-remixable: allow belongs_to #12

solnic opened this issue May 17, 2011 · 4 comments

Comments

@solnic
Copy link
Contributor

solnic commented May 17, 2011

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

@solnic
Copy link
Contributor Author

solnic commented May 17, 2011

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

@solnic
Copy link
Contributor Author

solnic commented May 17, 2011

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)

@solnic
Copy link
Contributor Author

solnic commented May 17, 2011

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)

@solnic
Copy link
Contributor Author

solnic commented May 17, 2011

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant