提交 eb300f84 编写于 作者: J Jeremy Kemper

AssociationCollection#any? takes a block [Michael Schoen]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 7370e54c
......@@ -116,9 +116,13 @@ def length
def empty?
size.zero?
end
def any?
!empty?
def any?(&block)
if block_given?
method_missing(:any?, &block)
else
!empty?
end
end
def uniq(collection = self)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册