Rails ActiveRecord - eager loading (sort of) when using 'build' from has_many -


I have a situation where children have been created, but have not been saved, and then parents' references Is being used in the scene with. This has extensive use of rail record caching. I have to 'curious load' parents with childhood records.

  class guardian & lt; ActiviverCord :: Base is_Im: Kids Deaf Make-Childer Loop .. Bal_Are & lt; & Lt; Children (Construction) End End  

Then in the scene (note that 'child' has not been saved in DB):

  children_re.each Do it Children # What is the best way to optimize this, does it not choose the parent only from the cash? Child.parent end  

I'm not sure that I understand the problem. Query cache is your friend ...! You are not calling the database that you are calling on .parent .

If you can include more information about what you are trying to do, then it may be easier to help with the problem.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -