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

avoiding tap saves us time

上级 2b8f2499
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册