I am developing a web app using rails 4 for the first time. I am making all of my model associations bidirectional and using inverse_of wherever it is allowed.
From reading the documentation, I've developed the impression that this is probably the best practice, but that's never really spelled out clearly anywhere.
I'd appreciate any general advice in this regard from experienced rails developers. I hope the question is not too vague to have value here.
Thanks!
Update: In addition to non-standard names, there appear to be two main additional cases where explicitly setting inverse_of is needed:
It is typically desirable to have inverses set up. The good news is that this is handled automatically in most cases. You usually only need to explicitly set the inverses for associations with non-standard names. You can find out a lot more in the official documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With