-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
Currently, when you do a create, it performs a query for all related (references_many) objects. This is really inefficient when those related collections are large.
For example, if a User references_many :posts, x = User.create will call x.posts.all.each ...
This happens in update_associations (here) where it calls:
{{send(name).each
if new_record?}}
I believe that code is incorrect, and should say unless new_record? instead. Although, I'm not sure why you need to loop through every related object anyway.