diff options
author | Sean Griffin <sean@thoughtbot.com> | 2015-01-29 13:57:13 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2015-01-29 13:57:47 -0700 |
commit | 38dd7939e67c127ebbd6cfbb81107b41474d744a (patch) | |
tree | 67b63ddadaceaae00f4fde7c3d15a8cd83576804 /activerecord/lib/active_record/relation | |
parent | 6296c09e5b915c522c4127844c623afb44c62e1a (diff) | |
download | rails-38dd7939e67c127ebbd6cfbb81107b41474d744a.tar.gz rails-38dd7939e67c127ebbd6cfbb81107b41474d744a.tar.bz2 rails-38dd7939e67c127ebbd6cfbb81107b41474d744a.zip |
Post.all.or(anything) == Post.all
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/where_clause.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/where_clause.rb b/activerecord/lib/active_record/relation/where_clause.rb index ce307e4f0c..f9b9e640ec 100644 --- a/activerecord/lib/active_record/relation/where_clause.rb +++ b/activerecord/lib/active_record/relation/where_clause.rb @@ -33,9 +33,9 @@ module ActiveRecord def or(other) if empty? - other - elsif other.empty? self + elsif other.empty? + other else WhereClause.new( [ast.or(other.ast)], |