Update for ActiveRecord 3 and Ruby 1.9