rails/rails — pull request #13555 by danmcclain (2013-12-31 13:01:21+00:00)
Title: Allows using relation name when querying joins/includes

When joining or including records, when querying the relation, you can use either the table name or the relation name:

Example:
Author.joins(:posts_with_comments).where(posts: { id: 1})
# or
Author.joins(:posts_with_comments).where(posts_with_comments: { id: 1})