是否使用 Ruby on Rails 关联

发布于 2024-12-25 16:51:42 字数 1432 浏览 5 评论 0原文

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

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

发布评论

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

评论(1

北音执念 2025-01-01 16:51:42

Rails 提供的关联提供了一些方法,可以使您的查询更简单、更具可读性、更易于维护和更有效。

尝试编写两个版本的 Customer-Orders 应用程序,然后编写 Customer-Order-Supplier 1) 具有关联的版本,另一个版本不具有关联,并执行一些不同类型的查询,并了解利用关联的查询的美妙之处。从执行的查询中,您还可以从 Rails 日志中看到它们所花费的时间。然后进入一些更复杂的例子进行更深入的研究。您可以在Rails 指南中找到一些简单的示例。

The associations that Rails provides you gives some methods that would make your querying simpler, more readable, maintainable and effective.

Try writing two versions of a Customer-Orders application and then Customer-Order-Supplier 1) with associations and the other without and perform some different type of queries and see the beauty of queries where associations was exploited. From the queries executed you can also see the time they take from the Rails log. Then go into some more complicated examples to delve deeper. You can find some simple examples to start with in the Rails guides.

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