带 Rails 的多表继承 3

发布于 2024-10-17 21:44:32 字数 311 浏览 7 评论 0原文

Rails 3 中的多表继承是否有标准或最佳实践?到目前为止,我能找到的最好的文章是:

http://mediumexposure.com/multiple- table-inheritance-active-record/

但即使如此也需要一些更改(例如将需求移至初始值设定项而不是旧的 /config/environment.rb)

有更好的资源/标准吗?

Are there standards or best practices yet when it comes to multi table inheritance in rails 3? So far the best article I could find was:

http://mediumexposure.com/multiple-table-inheritance-active-record/

But even that needed some changes(e.g. moving the requires to an initializer instead of the old /config/environment.rb)

Any better resources / standards?

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

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

发布评论

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

评论(3

箜明 2024-10-24 21:44:32

对于进行多表继承的简单方法,请查看“acts_as_relation”插件 https://github.com/hzamani /acts_as_relation

For an easy way to do multi-table inheritance take a look at 'acts_as_relation' plugin https://github.com/hzamani/acts_as_relation.

情未る 2024-10-24 21:44:32

我最近 fork 了一个很有前途的 gem 来在 Rails 中实现多表继承和类继承。我花了几天时间对其进行快速开发、修复、评论和文档,并将其重新发布为 CITIER(Rails 的类继承和表继承嵌入)。

考虑看一下: https://github.com/PeterHamilton/citier

它实际上需要一些概念从你提到的那篇文章中。

I recently forked a promising gem to implement multiple table inheritance and class inheritance in Rails. I have spent a few days subjecting it to rapid development, fixes, commenting and documentation and have re-released it as CITIER (Class Inheritance and Table Inheritance Embeddings for Rails).

Consider giving it a look: https://github.com/PeterHamilton/citier

It actually takes some concepts from that article you mention.

倾城°AllureLove 2024-10-24 21:44:32

我参加的 Melbourne Ruby 小组中有一个人写了几篇关于 Rails 中表继承的博客,其中的评论也非常有帮助。它不是专门针对 Rails 3 的,但其中肯定有一些不错的指南。

http://rhnh.net/2010/08/15 /class-table-inheritance-and-eager-loading

http://rhnh.net/2010/07/02/3-reasons-why-you-should-not-use-single-table-inheritance

快乐阅读

There's a guy in the Melbourne Ruby group I attend that's written a couple of blogs on table inheritance in rails and the comments are really helpful as well. It's not specifically Rails 3 but there's definitely some decent pointers in there.

http://rhnh.net/2010/08/15/class-table-inheritance-and-eager-loading

http://rhnh.net/2010/07/02/3-reasons-why-you-should-not-use-single-table-inheritance

happy reading

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