Fixed that :includes merged from with_scope won't cause the same association...

Fixed that :includes merged from with_scope won't cause the same association to be loaded more than once if repetition occurs in the clauses (closes #5253) [alex@purefiction.net]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4415 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 9422e71c
*SVN*
* Fixed that :includes merged from with_scope won't cause the same association to be loaded more than once if repetition occurs in the clauses #5253 [alex@purefiction.net]
* Allow models to override to_xml. #4989 [Blair Zajac <blair@orcaware.com>]
* PostgreSQL: don't ignore port when host is nil since it's often used to label the domain socket. #5247 [shimbo@is.naist.jp]
>>>>>>> .r4414
* Records and arrays of records are bound as quoted ids. [Jeremy Kemper]
Foo.find(:all, :conditions => ['bar_id IN (?)', bars])
Foo.find(:first, :conditions => ['bar_id = ?', bar])
......
......@@ -1022,7 +1022,7 @@ def construct_finder_sql(options)
# Merges includes so that the result is a valid +include+
def merge_includes(first, second)
safe_to_array(first) + safe_to_array(second)
(safe_to_array(first) + safe_to_array(second)).uniq
end
# Object#to_a is deprecated, though it does have the desired behavior
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册