Rails 3 integrated with Sequel?
There appear to be at least four repos on git开发者_JS百科hub that claim to tie in Sequel to the latest Rails 3 beta.
Has anyone successfully replaced ActiveRecord with Sequel in a Rails 3 project? Could you provide some hints on how to best go about it?
I'm interested in starting a new project on Rails 3 and trying to get off on the right foot: ideally sequel, minitest, and omniauth (with devise if it won't be painful). I know this is not the blessed stack, but these gems appeal to my spidey sense. I'm looking for any advice that will help me work through any gem issues and conflicts.
I've used Sequel with Rails 2 and 3. If you aren't using any of the ActiveRecord integration features, it's actually easy even with Rails 2, you just have to set up the Sequel database connection manually either in an environment file (environment.rb or environments/*.rb), or in an initializer. Your Sequel models still go in app/models/.
With Rails 3 and the Sequel active_model plugin, integration should work fine from a code perspective. Most of what the github repos do is deal with things like rake tasks and generators, which while nice, are not actually necessary.
Because sequel-rails no longer seems to be maintained, I looked for forks. The TalentBox version seems to be promising and is actively maintained.
I have to add however, the migrations (rake db:migrate
and the like) seem to be somewhat broken. There are some patches in my fork, see the iblue/sequel-rails production branch. I will eventually push them to talentbox, when the are stable.
EDIT: TalentBox is working quite fine now.
精彩评论