Skip to content

Instantly share code, notes, and snippets.

#### fetches the ids
>> ii=Inbro.find(:all, :limit=>5)
Inbro Load Scrooged (0.3ms) SELECT `inbro`.id FROM `inbro` LIMIT 5
#### causes reload of all columns, and fetches id of each client. Association is noted.
>> ii.each {|i| i.inbro_client.id}
Inbro Scrooge Reload (15.0ms) SELECT `inbro`.name,`inbro`.header,`inbro`.prompt,`inbro`.banner_name,`inbro`.banner_width,`inbro`.banner_height
FROM `inbro` WHERE `inbro`.id IN ('1','2','3','4','5')
InbroClient Load Scrooged (58.9ms) SELECT `inbro_client`.id FROM `inbro_client` WHERE (`inbro_client`.`id` = 7120)
InbroClient Load Scrooged (0.5ms) SELECT `inbro_client`.id FROM `inbro_client` WHERE (`inbro_client`.`id` = 7120)
Country Load Scrooged (1.6ms) SELECT `countries`.id FROM `countries` WHERE (id IN
(10,33,48,70,81,82,90,124,136,146,147,170,175,176,186,181,54,80,94,185,194,27,45,63,131,40,7,
38,144,168,165,8,22,31,39,46,53,59,83,85,92,96,99,100,105,111,112,114,128,132,137,150,152,163,
164,171,172,177,190,196,198,199,207,62,180,25,126,9,339,342,47,89,208,6,119,43,293,24,345,115,
110,21,84,227,354,361,73,79,371,34,87,193,69,151,58,195,191,102,118,66,257,161,315,323,129,67,
17,28,159,68,134,366,65,265,18,229,61,77,64,331,184,255,359,349,356,50,149,299,365,357,41,358,
201,178,355,49,215,35,91,60,130,362,20,145,122,12,327,15,154,192,113,4,153,335,155,19,182,71,
169,95,52,74,200,108,138,101,107,123,187,368,13,2,72,16,11,360,135,55,376,188,156) AND continent='Asia')
SQL (1.2ms) SELECT `countries`.date,`countries`.country,`countries`.continent,`countries`.parent_country,
`countries`.official_name,`countries`.status,`countries`.highest_point,`countries`.height,
require 'set'
module ActiveRecord
class Base
attr_accessor :is_scrooged, :scrooge_callsite_signature, :scrooge_own_callsite_set
@@scrooge_mutex = Mutex.new
@@scrooge_callsites = {}
@@scrooge_select_regexes = {}