Improve where.not docs [ci skip]

* Fix example queries
* Remove doc entries of where.like/not_like.
* Remove :chain from where.not related docs. To me that's an implementation
  detail and we don't expect people to use where(:chain).not.
This commit is contained in:
Carlos Antonio da Silva 2012-12-08 14:21:06 -02:00
parent 49295e72d3
commit 7d42317e3d
1 changed files with 8 additions and 14 deletions

View File

@ -18,13 +18,13 @@ module ActiveRecord
# See #where for more details on each format.
#
# User.where.not("name = 'Jon'")
# # SELECT * FROM users WHERE name <> 'Jon'
# # SELECT * FROM users WHERE NOT (name = 'Jon')
#
# User.where.not(["name = ?", "Jon"])
# # SELECT * FROM users WHERE name <> 'Jon'
# # SELECT * FROM users WHERE NOT (name = 'Jon')
#
# User.where.not(name: "Jon")
# # SELECT * FROM users WHERE name <> 'Jon'
# # SELECT * FROM users WHERE name != 'Jon'
#
# User.where.not(name: nil)
# # SELECT * FROM users WHERE name IS NOT NULL
@ -415,21 +415,15 @@ module ActiveRecord
# User.joins(:posts).where({ "posts.published" => true })
# User.joins(:posts).where({ posts: { published: true } })
#
# === no argument or :chain
# === no argument
#
# If no argument or :chain is passed, #where returns a new instance of WhereChain which, when
# chained with either #not, #like, or #not_like, returns a new relation.
# If no argument is passed, #where returns a new instance of WhereChain, that
# can be chained with #not to return a new relation that negates the where clause.
#
# User.where.not(name: "Jon")
# # SELECT * FROM users WHERE name <> 'Jon'
# # SELECT * FROM users WHERE name != 'Jon'
#
# Book.where.like(title: "Rails%")
# # SELECT * FROM books WHERE title LIKE 'Rails%'
#
# Conference.where.not_like(name: "%Kaigi")
# # SELECT * FROM conferences WHERE name NOT LIKE '%Kaigi'
#
# See WhereChain for more details on #not, #like, and #not_like.
# See WhereChain for more details on #not.
#
# === blank condition
#