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

Pass association finder arguments through to the association class exactly as...

Pass association finder arguments through to the association class exactly as we received them.  Fixes case where parent.children.find() is interpreted as Child.find([]) instead of Child.find().

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1498 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 28012e68
......@@ -78,7 +78,9 @@ def find(*args)
options[:order] = @options[:order]
end
@association_class.find(args.size == 1 ? args.first : args, options)
# Pass through args exactly as we received them.
args << options
@association_class.find(*args)
end
end
......
......@@ -316,7 +316,7 @@ def test_belongs_to_sanity
end
def test_find_ids
firm = Firm.find_first
firm = Firm.find(:first)
assert_raises(ActiveRecord::RecordNotFound) { firm.clients.find }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册