Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

avoiding tap saves us time

  • Loading branch information...
commit a56ee4c9a23ca4f41ea001810a7c2358cc043f1d 1 parent dac2b37
@tenderlove tenderlove authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 activerecord/lib/active_record/relation/query_methods.rb
View
8 activerecord/lib/active_record/relation/query_methods.rb
@@ -49,7 +49,9 @@ def joins(*args)
def where(opts, *rest)
value = build_where(opts, rest)
- value ? clone.tap {|r| r.where_values += Array.wrap(value) } : clone
+ copy = clone
+ copy.where_values += Array.wrap(value) if value
+ copy
end
def having(*args)
@@ -58,7 +60,9 @@ def having(*args)
end
def limit(value = true)
- clone.tap {|r| r.limit_value = value }
+ copy = clone
+ copy.limit_value = value
+ copy
end
def offset(value = true)
Please sign in to comment.
Something went wrong with that request. Please try again.