Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Port of ActiveRecord Rake Tasks for Sinatra

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 config
Octocat-spinner-32 tasks
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 sinatra_activerecord.rb
Sinatra ActiveRecord Tasks

Git URL:

This is a port of the ActiveRecord rake tasks that you can drop in to your sinatra application. By default, it requires the ActiveRecord gem.

After cloning, you need to copy everything on the cloned directory, to your sinatra's root directory. Be careful not to override your Rakefile (if you have any) else just copy what's packaged here.

After copying, then feel free to call `rake -T` 

and now use 'require sinatra_activerecord' to use activerecord on your sinatra app, like this.

require 'sinatra'
require 'sinatra_activerecord'

then connect to your db

configure  do
  ActiveRecord::Base.configurations = database_configuration
  ActiveRecord::Base.logger ="activerecord.log") # Somehow you need logging right?

- Technically, RAILS_ROOT and RAILS_ENV are replaced as APP_ROOT and APP_ENV, so if you want to execute tasks on an  environment, just call rake db:migrate APP_ENV=production

- Somehow, i wasn't able to fix yet rake db:create / db:create:all on sqlite3 so feel free to patch in (or patch rails activerecord itself)

Something went wrong with that request. Please try again.