diff options
author | Maxime Lapointe <hunter_spawn@hotmail.com> | 2017-07-28 17:53:50 -0400 |
---|---|---|
committer | Maxime Lapointe <hunter_spawn@hotmail.com> | 2017-07-28 17:53:50 -0400 |
commit | be81b5066074fee8126144d072c6132b93d1fe39 (patch) | |
tree | a4b10eb9b74be4a561ae0594dcb6221066dbf9c6 /activerecord/lib/active_record | |
parent | 110e0e1fcceab68716e0c75d87baffb14403b288 (diff) | |
download | rails-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.rb | 14 |
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) |