Fix HasManyAssociation#find bugs when :finder_sql is set (closes #4600) [lagroue@free.fr]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4176 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 2fa5bf03
*SVN*
* Fixed HasManyAssociation#find bugs when :finder_sql is set #4600 [lagroue@free.fr]
* Allow AR::Base#respond_to? to behave when @attributes is nil [zenspider]
* Support eager includes when going through a polymorphic has_many association. [Rick]
......
......@@ -59,7 +59,7 @@ def find(*args)
if ids.size == 1
id = ids.first
record = load_target.detect { |record| id == record.id }
expects_array? ? [record] : record
expects_array ? [ record ] : record
else
load_target.select { |record| ids.include?(record.id) }
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册