1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #26245 from danila/quering-interface-guide

Change form of table name to plural in quering interface guides [ci skip]
This commit is contained in:
Vipul A M 2016-08-22 18:09:21 +05:30 committed by GitHub
commit eb8a1e2df8

View file

@ -1014,13 +1014,13 @@ There are multiple ways to use the `joins` method.
You can just supply the raw SQL specifying the `JOIN` clause to `joins`:
```ruby
Author.joins("INNER JOIN posts ON posts.author_id = author.id AND posts.published = 't'")
Author.joins("INNER JOIN posts ON posts.author_id = authors.id AND posts.published = 't'")
```
This will result in the following SQL:
```sql
SELECT clients.* FROM clients INNER JOIN posts ON posts.author_id = author.id AND posts.published = 't'
SELECT clients.* FROM clients INNER JOIN posts ON posts.author_id = authors.id AND posts.published = 't'
```
#### Using Array/Hash of Named Associations