aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorTim Sandberg <tasandberg@gmail.com>2015-12-30 15:51:13 -0800
committerTim Sandberg <tasandberg@gmail.com>2015-12-30 15:51:13 -0800
commit56bc3e1fb3e518c091aa588e9222bc0ed6160e10 (patch)
treec8c479a8f0c83870c9c6c6d6a0fb678d7f3305f5 /activerecord/lib
parent904e3f4465cb2b874bd99000e96e2e6e0e03844c (diff)
downloadrails-56bc3e1fb3e518c091aa588e9222bc0ed6160e10.tar.gz
rails-56bc3e1fb3e518c091aa588e9222bc0ed6160e10.tar.bz2
rails-56bc3e1fb3e518c091aa588e9222bc0ed6160e10.zip
Improve example of #or to use different column values in the where clauses
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index 983bf019bc..b86cc094fc 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -649,8 +649,8 @@ module ActiveRecord
# they must differ only by #where (if no #group has been defined) or #having (if a #group is
# present). Neither relation may have a #limit, #offset, or #distinct set.
#
- # Post.where("id = 1").or(Post.where("id = 2"))
- # # SELECT `posts`.* FROM `posts` WHERE (('id = 1' OR 'id = 2'))
+ # Post.where("id = 1").or(Post.where("author_id = 3"))
+ # # SELECT `posts`.* FROM `posts` WHERE (('id = 1' OR 'author_id = 3'))
#
def or(other)
spawn.or!(other)