Return of the Beer.new

Beer.drinkable

Yes that’s right, last month when I was visiting the Sydney Ruby on Rails monthly meetup I was introduced to the Beer model, not the type of model your thinking about, something more along the lines of:

class Beer < ActiveRecord::Base
  CAT_PISS = 2
  named_scope :drinkable, :conditions => ['quality > ?', CAT_PISS]
  # ...
end
 
Beer.drinkable
 
#=> [#<Beer id: 25, name: "Tooheys New", quality: 4, rating: 7.1, best_served: "cold">, 
#<Beer id: 17, name: "Corona", quality: 7, rating: 9.0, best_served: "cold with lime" >]

(Its a Rails thing)