aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/query_methods.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-12-08 14:21:06 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-12-08 14:24:23 -0200
commit7d42317e3dad0a9045dbe1fc64270e03433b1d7c (patch)
tree77c8097a7251cf969bfc2098a45c297133332ebd /activerecord/lib/active_record/relation/query_methods.rb
parent49295e72d3f50e28d12aee2f41a049ac685effa7 (diff)
downloadrails-7d42317e3dad0a9045dbe1fc64270e03433b1d7c.tar.gz
rails-7d42317e3dad0a9045dbe1fc64270e03433b1d7c.tar.bz2
rails-7d42317e3dad0a9045dbe1fc64270e03433b1d7c.zip
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.
Diffstat (limited to 'activerecord/lib/active_record/relation/query_methods.rb')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb22
1 files changed, 8 insertions, 14 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index f6d106f304..46c0d6206f 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -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
#