2008/12/2 acechase <[EMAIL PROTECTED]> > > On Dec 1, 12:14 pm, "Michael Koziarski" <[EMAIL PROTECTED]> wrote: > > > As for the bi-directionality of in-memory AR objects, you should check > > > out the parental-control plugin, which while incomplete, covers quite > > > a bit of what is needed to support bi-directional associations in > > > rails: > > >http://github.com/h-lame/parental_control/tree/master > > > > Nice! I'd love to see something along these lines baked right in to 2.3 > > > > -- > > Cheers > > > > Koz > > Three cheers to that! h-lame has done some really good work getting > the parental_control plugin working, but I think it would make > hammering out the trickier bits much easier if it was part of core.
Ah-ha! Now I understand why my little un-announced plugin suddenly got some watchers on github ;) So, here seems like as good a place as any to thrash it out. What do we think I/we'd need to do to get it into core? As someone pointed out, it's pretty incomplete so I'm sure I've not covered all the edge cases, although I think it does a pretty good job of giving up if it can't find something that it thinks is the right inverse / reciprocal relationship (and we're using it in a production app here and it's yet to fall over). The first natural extension to me would be to allow for :inverse options on association definitions that would allow for getting round trying to work it out, e.g. something like: class FlamingStick < ActiveRecord::Base belongs_to :extreme_juggler, :inverse => :flaming_sticks end class ExtremeJuggler < ActiveRecord::Base has_many :flaming_sticks, :inverse => :extreme_juggler end Although, for these simple cases it does seem like extra work that the framework should be able to work it out for you, so I don't think I'm hugely in favour of dropping the "magic" auto-detection. Anything else / anyone else used it and spotted stuff I haven't? Cheers, Muz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" 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/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
