Neeraj Singh
Member of 1 project: Ruby on Rails
Neeraj Singh's latest activity
Saturday, November 13 2010
-
Neeraj Singh commented at 5:23 PM@Santiago
I tested your patch and it works great. Great solution. Thanks for teaching.
Friday, November 12 2010
-
Neeraj Singh commented at 7:03 PMMy previous patch reduced the number of sql queries from 3 to 2.
Then new attached patch is reducing the number of sql queries from 3 to 1.
-
Neeraj Singh commented at 6:57 PMYou are right. It should be .length. I usually avoid length because it does select and not select count but in this case if the number of records is more than o...
-
Neeraj Singh commented at 5:38 PMThat's what I was saying. May be I was not clear enough.
This blog has more info on the same topic with greater clarity http://blog.hasmanythrough.com/2008/2/27...
-
- Assigned user set to Santiago Pastorino
When the execution comes to @collection, at that time @collection is a Relation and that is not loaded. Since it is not loaded whether you call .length or .size...
-
- Tag set to patched
Attached is code patch. Not sure how to count how many sql statements have been generated in the whole view.
-
Neeraj Singh commented at 6:39 PMCan you post model with scope so that I could reproduce the problem. Thanks
-
- Assigned user set to José Valim
Assigning it to Mr. Valim because the question has more to do with historical context. And he has been around a long time :-)