Permalink
Browse files

Tidied up method calls

  • Loading branch information...
1 parent 7ddf2f8 commit 4b649c2cf3d5e35a44a40ce734fede26ebc69462 Jonathan Lozinski committed Jun 21, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 activerecord/lib/active_record/relation/query_methods.rb
@@ -305,10 +305,8 @@ def where!(opts, *rest)
# # SELECT * FROM users WHERE name = 'Alice' OR email = 'joe@example.com'
#
def or(scope)
- mywhere = self.where_values.dup
- orwhere = scope.where_values.dup
- left = mywhere.inject {|l,r| l.and(r)}
- right = orwhere.inject {|l,r| l.and(r)}
+ left = self.where_values.inject {|l,r| l.and(r)}
+ right = scope.where_values.inject {|l,r| l.and(r)}
self.unscoped.where(left.or(right))
end

0 comments on commit 4b649c2

Please sign in to comment.