aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorMaxime Lapointe <hunter_spawn@hotmail.com>2017-07-28 17:53:50 -0400
committerMaxime Lapointe <hunter_spawn@hotmail.com>2017-07-28 17:53:50 -0400
commitbe81b5066074fee8126144d072c6132b93d1fe39 (patch)
treea4b10eb9b74be4a561ae0594dcb6221066dbf9c6 /activerecord/lib/active_record
parent110e0e1fcceab68716e0c75d87baffb14403b288 (diff)
downloadrails-be81b5066074fee8126144d072c6132b93d1fe39.tar.gz
rails-be81b5066074fee8126144d072c6132b93d1fe39.tar.bz2
rails-be81b5066074fee8126144d072c6132b93d1fe39.zip
Edits following the reviews
Diffstat (limited to 'activerecord/lib/active_record')
-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)