Rails 3 与 Sequel 集成?

发布于 2024-11-01 21:28:17 字数 356 浏览 1 评论 0原文

似乎至少有 github 上有四个存储库声称与最新版本的 Sequel 相关联Rails 3 测试版。

有人在 Rails 3 项目中成功用 Sequel 替换了 ActiveRecord 吗?您能否提供一些有关如何最好地进行此操作的提示?

我有兴趣在 Rails 3 上开始一个新项目,并试图取得良好的进展:理想的是sequel、minitest 和omniauth(如果不会很痛苦的话,可以使用devise)。我知道这不是受祝福的堆栈,但这些宝石吸引了我的蜘蛛侠意识。我正在寻找任何可以帮助我解决宝石问题和冲突的建议。

There appear to be at least four repos on github 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

药祭#氼 2024-11-08 21:28:17

我在 Rails 2 和 3 中使用了 Sequel。如果您没有使用任何 ActiveRecord 集成功能,即使使用 Rails 2,实际上也很容易,您只需在环境文件(环境.rb 或environments/*.rb),或在初始化程序中。您的续集模型仍然位于 app/models/ 中。

使用 Rails 3 和 Sequel active_model 插件,从代码角度来看,集成应该可以正常工作。 github 存储库所做的大部分工作是处理诸如 rake 任务和生成器之类的事情,这些虽然很好,但实际上并不是必需的。

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.

鸢与 2024-11-08 21:28:17

因为sequel-rails似乎不再被维护,所以我寻找了fork。 TalentBox 版本 似乎很有前途并且正在积极维护。

不过,我必须补充一点,迁移(rake db:migrate 等)似乎有些损坏。我的 fork 中有一些补丁,请参阅 iblue/sequel-rails 生产分支< /a>。当它们稳定时,我最终会将它们推入天赋箱。

编辑: TalentBox 现在工作得很好。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文