mike ward content follows

Archive for April, 2009

activerecord wrapper for sinatra

Posted in sinatra, database on April 15th, 2009

Graeme Nelson shared a database wrapper class for sinatra that encapsulated Sequel so that he could run migrations and gracefully use it in different environments. It’s nice because then it just does the right thing in development, test and production (or whatever) and keeps your main code cleaner.

Here is a modification of that class that I’m using. I’m still using the old ORM - ActiveRecord, so the (minor) changes I made to his class are only to make it work for AR.

To use it be sure to create a .twitter directory, and place your tweetlist.yml file in there, formatted like so: