Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 10th, 2012  |  syntax: None  |  size: 0.83 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. > ActiveRecord::Base.logger = Logger.new(STDOUT)
  2. > Infrastructure::Radio.first
  3. Infrastructure::Radio Load (0.8ms)  SELECT "radio_channels".* FROM "radio_channels" LIMIT 1
  4. +----+------------+
  5. | id | ut_id_name |
  6. +----+------------+
  7. | 1  | 245        |
  8. +----+------------+
  9.  
  10. > counter = 0; Infrastructure::Radio.first.foo.each {counter += 1}; puts counter
  11. Infrastructure::Radio Load (0.4ms)  SELECT "radio_channels".* FROM "radio_channels" LIMIT 1
  12. UserTranslation Load (1.0ms)  SELECT "user_translations".* FROM "user_translations"
  13.  => 76
  14.  
  15. > Infrastructure::Radio.first.foo.count
  16. Infrastructure::Radio Load (0.4ms)  SELECT "radio_channels".* FROM "radio_channels" LIMIT 1
  17. UserTranslation Load (0.8ms)  SELECT "user_translations".* FROM "user_translations"
  18. SQL (0.6ms)  SELECT COUNT(*) FROM "user_translations" WHERE ("user_translations".key = 245)
  19.  => 1