New rails_sequel Plugin

Recently, I was porting an Merb and Rails application from DataMapper to Sequel. It is pretty much straightforward with Merb, as you only have to specify use_orm :sequel in your init.rb file to get Sequel configured automatically.

With Rails you have to do this manually eg.:

DB = Sequel.connect('mysql://localhost/database')

or… use my new plugin rails_sequel.

rails_sequel is a simple plugin which loads Sequel, reads database.yml file and adds missing methods such as to_param or new_record?.

You can install it like any other Rails plugin:

script/plugin install git://

Alternatively you can install a gem:

# Initializer for the class.
def initialize( string )
  @str = string

Load the gem in environment.rb do |config|
  config.gem 'pusewicz-rails_sequel', :version => '~> 0.0.2', :lib => 'rails_sequel', :source => ''

You might want to remove ActiveRecord framework in environment.rb file as well:

config.frameworks -= [ :active_record ]

Last modified: 09-Apr-23