Ruby on Rails中,非必需的references也能在连接上使用吗?

2026-04-11 14:450阅读0评论SEO教程
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计803个文字,预计阅读时间需要4分钟。

Ruby on Rails中,非必需的references也能在连接上使用吗?

我知道当你使用 `includes` 并在 `join` 表上指定 `where` 子句时,你应该使用 `.references()` 来指定关联的字段。例如:`.includes('table_name', 'foreign_key:local_key')`。

阅读全文

本文共计803个文字,预计阅读时间需要4分钟。

Ruby on Rails中,非必需的references也能在连接上使用吗?

我知道当你使用 `includes` 并在 `join` 表上指定 `where` 子句时,你应该使用 `.references()` 来指定关联的字段。例如:`.includes('table_name', 'foreign_key:local_key')`。

阅读全文