By nahum | September 12, 2008
I’ve just encountered this problem yet again effecting code I’m working though, so I thought I’d quickly blog about it.
Put basically if you call count on a relationship it will always make a db call to see how many there are even if the relationship has been populated. If you use size or any? they [...]
By nahum | September 11, 2008
I recently gave a presentation about using named_scopes to WellRailed and while it was still on my mind I thought that I’d cover named_scope in conjunction with some performance optimisation work I’ve been doing.
I used to use relationship extensions lots and it always irked me that I was putting business logic for a model, say [...]
By nahum | September 3, 2008
So far I’ve configured Nginx to handle file uploads by caching the file to disk and telling rails where it is, rather than passing it through in the request, not fun with large files. Now to do the reverse. Instead of Rails sending files to users thru Nginx, Rails can tell Nginx what file to [...]