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

Untitled

By: a guest on Jul 18th, 2012  |  syntax: None  |  size: 1.20 KB  |  hits: 7  |  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. ruby whitespace
  2. max_stuff = FooSummary.select("max(stuff) as stuff")
  3.                         .joins(:foo => :bar)
  4.                         .where("user_id = ? and record_date < ?", r.user_id, r.record_date)
  5.                         .group("user_id")
  6.                         .first
  7.        
  8. foo = bar
  9.        
  10. .baz
  11.        
  12. foo = bar.
  13.        
  14. baz
  15.        
  16. max_stuff = FooSummary.select("max(stuff) as stuff")
  17.                     .joins(:foo => :bar)
  18.                     .where("user_id = ? and record_date < ?", r.user_id, r.record_date)
  19.                     .group("user_id")
  20.                     .first
  21.        
  22. max_stuff = FooSummary.select(
  23.                               "max(stuff) as stuff"
  24.                      ).joins(
  25.                              :foo => :bar
  26.                      ).where(
  27.                              "user_id = ? and record_date < ?", r.user_id, r.record_date
  28.                      ).group(
  29.                              "user_id"
  30.                      ).first
  31.        
  32. max_stuff = FooSummary.select("max(stuff) as stuff").
  33.                        joins(:foo => :bar).
  34.                        where("user_id = ? and record_date < ?", r.user_id, r.record_date).
  35.                        group("user_id").
  36.                        first