From 01a52dd1ad51034b10a8386db7b1aae83f32a59d Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 3 Jun 2006 21:11:48 +0000 Subject: 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 --- activerecord/lib/active_record/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/base.rb') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 0a81681126..1583c28efe 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1022,7 +1022,7 @@ module ActiveRecord #:nodoc: # 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 -- cgit v1.2.3