Borrow working code from Sinatra-ActiveRecord