I am new to mongoid. i start doing mongoid with rubyonrails with help of screen cast #238 of Ryan bate.
I found in the section of "Reference" of mongoid official website describing about the has_many.
Can anyone help me to explain what is the difference between has_many and references_many and which version of mongoid support them.
Thanks you very much.
From mongoid doc you can read this :
http://mongoid.org/docs/upgrading.html
Relational associations no longer autosave when the parent relation is created. Previously a save on a new document which had a references_many or references_one association loaded would save the relations on it's first save. In order to get this functionality back, an autosave: true option must be provided to the macro (This only applies to references_many and references_one):
So now I think there is no differences and you can fill free to use has_many
with options autosave: true
if you need to :)
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