This project is archived and is in readonly mode.
Backport :inverse_of from 3.0 to 2.3.x
-
Murray Steele
Also, note that George Ogata has a couple of other tickets ([1], [2]) about improving the inverse_of functionality. We should probably apply them to edge and 2-3-stable as well.
[1] https://rails.lighthouseapp.com/projects/8994/tickets/3520-add-inve... [2] https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets...
-
Murray Steele
Um... that 2nd link should be to https://rails.lighthouseapp.com/projects/8994/tickets/3513-inverse_... not back to this one.
-
George Ogata
Tested both my patches on top of Murray's patch on 2-3-stable. The whole stack applies cleanly and the tests pass. It's also quite a simple modification to ActiveRecord all up.
Not sure what the above mentioned issues are that would be aided by inverse associations, but I'm keen to see this functionality in sometime soon. Until then, I have a plugin which backports it for 2.x apps to use right now, for anyone that's interested.
-
Eloy Duran
- Assigned user changed from Eloy Duran to Michael Koziarski
- Milestone set to 2.3.6
Thanks for the work Murphy! The most heard ‘issue’ is that people that use NestedAttributes can’t validate the presence of the parent. Also in multiple cases I really wanted to have access to the parent during building an associated record.
I’ve applied the patch, plus a patch from master that adds tests for the aforementioned validation problem.
http://github.com/Fingertips/rails/commits/2-3-stable
I’ve also checked George's patches, they indeed apply and the tests run. But I'd like to know if anyone else has been using these patches on a real app before I push them? Besides George that is ;)
All in all, since 2.3.5 has recently been released, I think it would be best that if this will be applied to 2.3.x we do it asap. So people have time to actually test it a while before 2.3.6 is released.
-
George Ogata
I think it's safe to say my patches haven't been used much by others yet. I only wrote them recently.
That said, one is just a one-line bug fix. The polymorphic support is a little more involved - your call. I agree sooner would be better, though, for the reason you cited.
-
Murray Steele
Updated the patch to also include the patch committed to master that resolves [2815].
-
Murray Steele
I clearly meant #2815.
-
Eloy Duran
- State changed from new to resolved
