
Untitled
By: a guest on
May 10th, 2012 | syntax:
None | size: 0.83 KB | hits: 17 | expires: Never
> ActiveRecord::Base.logger = Logger.new(STDOUT)
> Infrastructure::Radio.first
Infrastructure::Radio Load (0.8ms) SELECT "radio_channels".* FROM "radio_channels" LIMIT 1
+----+------------+
| id | ut_id_name |
+----+------------+
| 1 | 245 |
+----+------------+
> counter = 0; Infrastructure::Radio.first.foo.each {counter += 1}; puts counter
Infrastructure::Radio Load (0.4ms) SELECT "radio_channels".* FROM "radio_channels" LIMIT 1
UserTranslation Load (1.0ms) SELECT "user_translations".* FROM "user_translations"
=> 76
> Infrastructure::Radio.first.foo.count
Infrastructure::Radio Load (0.4ms) SELECT "radio_channels".* FROM "radio_channels" LIMIT 1
UserTranslation Load (0.8ms) SELECT "user_translations".* FROM "user_translations"
SQL (0.6ms) SELECT COUNT(*) FROM "user_translations" WHERE ("user_translations".key = 245)
=> 1