提交 d277e871 编写于 作者: C Carlos Antonio da Silva

Fix typo and make indent/examples consistent on docs for `where.missing`

[ci skip]
上级 00c010c5
......@@ -76,18 +76,18 @@ def not(opts, *rest)
# For example, posts that are missing a related author:
#
# Post.where.missing(:author)
# SELECT "posts".* FROM "posts"
# LEFT OUTER JOIN "authors" ON "authors"."id" = "posts"."author_id"
# WHERE "authors"."id" IS NULL
# # SELECT "posts".* FROM "posts"
# # LEFT OUTER JOIN "authors" ON "authors"."id" = "posts"."author_id"
# # WHERE "authors"."id" IS NULL
#
# Additionally, multiple relations can be combined. This will retrun posts
# that are missing both an author and any comments:
# Additionally, multiple relations can be combined. This will return posts
# that are missing both an author and any` comments:
#
# Post.where.missing(:author, :comments)
# SELECT "posts".* FROM "posts"
# LEFT OUTER JOIN "authors" ON "authors"."id" = "posts"."author_id"
# LEFT OUTER JOIN "comments" ON "comments"."post_id" = "posts"."id"
# WHERE "authors"."id" IS NULL AND "comments"."id" IS NULL
# # SELECT "posts".* FROM "posts"
# # LEFT OUTER JOIN "authors" ON "authors"."id" = "posts"."author_id"
# # LEFT OUTER JOIN "comments" ON "comments"."post_id" = "posts"."id"
# # WHERE "authors"."id" IS NULL AND "comments"."id" IS NULL
def missing(*args)
args.each do |arg|
reflection = @scope.klass._reflect_on_association(arg)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册