提交 4b5f417e 编写于 作者: E Emilio Tagua

Only yield block if given.

上级 2c203a94
......@@ -22,9 +22,9 @@ def #{query_method}(*args, &block)
end
class_eval <<-CEVAL, __FILE__, __LINE__ + 1
def select(*args, &block)
def select(*args)
if block_given?
to_a.select(&block)
to_a.select { |*block_args| yield(*block_args) }
else
new_relation = clone
value = Array.wrap(args.flatten).reject {|x| x.blank? }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册