提交 0f502ab8 编写于 作者: A Aaron Patterson

avoiding tap saves us time

上级 2b8f2499
...@@ -49,7 +49,9 @@ def joins(*args) ...@@ -49,7 +49,9 @@ def joins(*args)
def where(opts, *rest) def where(opts, *rest)
value = build_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 end
def having(*args) def having(*args)
...@@ -58,7 +60,9 @@ def having(*args) ...@@ -58,7 +60,9 @@ def having(*args)
end end
def limit(value = true) def limit(value = true)
clone.tap {|r| r.limit_value = value } copy = clone
copy.limit_value = value
copy
end end
def offset(value = true) def offset(value = true)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册