aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/relation/where_clause.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/relation/where_clause.rb b/activerecord/lib/active_record/relation/where_clause.rb
index 5b68c25bdd..752bb38481 100644
--- a/activerecord/lib/active_record/relation/where_clause.rb
+++ b/activerecord/lib/active_record/relation/where_clause.rb
@@ -36,12 +36,14 @@ module ActiveRecord
common = self - left
right = other - common
- return common if left.empty? || right.empty?
-
- or_clause = WhereClause.new(
- [left.ast.or(right.ast)]
- )
- common + or_clause
+ if left.empty? || right.empty?
+ common
+ else
+ or_clause = WhereClause.new(
+ [left.ast.or(right.ast)],
+ )
+ common + or_clause
+ end
end
def to_h(table_name = nil)