On Sun, Sep 27, 2009 at 21:47, Dan Kubb (dkubb) <[email protected]> wrote: > > Jacques, > >> Agreed, just that in this case I think it does make sense for it to >> work similarly. Doesn't seem like its catering to lowest common >> denominator as this is how DM was working up until fairly recently. > > Actually, as long as I've been involved with DM, Resource#save!, > Model#create!, Collection#update!, etc never worked that way. > > In fact, Resource#save! wasn't even part of dm-core until 0.10, up > until now it was just part of dm-validations. > >> By the way, that snippet (http://gist.github.com/170779) Dan provided >> is a friggin awesome technique. The syntax looks atrocious (ruby >> really needs a cleaner way to have models define class behavior), but >> that'll be incredibly useful now that I have it on my snippet library. > > Yeah, I agree, it is a bit gross, but the messiness is contained in a > single spot in the code base so the overall impact is small. Even > still, if anyone has suggestions on a cleaner API, I'd love to hear > it. > > Actually, I was thinking what if it would be possible to define > properties, relationships and instance methods in a *module*, and then > include that module in model classes. The module would basically end > up looking just like a model does, but you'd get the benefit of being > able to share code between multiple models without any special syntax.
That would be very awesome! Not even would it reduce the need for something like dm-is-remixable, it will even help make its implementation much cleaner! > > -- > > 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 -~----------~----~----~----~------~----~------~--~---
