When Form Meets Function
The beauty of Ruby on Rails never cease to amaze me:
# Oneliner split for layout purpose
now = Time.now
qc = QueryCounter.find_or_create_by_date_and_hour(now, now.hour)
qc.increase!("count_#{query_type}")
Yes, this snippet does exactly what it reads: no more no less. It just works.

