aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-04-06 03:06:36 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-04-06 03:06:36 +0000
commitdcee137c7b0998b1533c5a028faf5a736078ade3 (patch)
treea1a8ec4509138dda37e55c1b3b43d602cf425db9 /activerecord/lib/active_record/associations
parent2fa5bf03dd0105a70402b1abcf0ac3df54140a55 (diff)
downloadrails-dcee137c7b0998b1533c5a028faf5a736078ade3.tar.gz
rails-dcee137c7b0998b1533c5a028faf5a736078ade3.tar.bz2
rails-dcee137c7b0998b1533c5a028faf5a736078ade3.zip
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
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/has_many_association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_association.rb b/activerecord/lib/active_record/associations/has_many_association.rb
index 8d82de0d01..52cad79484 100644
--- a/activerecord/lib/active_record/associations/has_many_association.rb
+++ b/activerecord/lib/active_record/associations/has_many_association.rb
@@ -59,7 +59,7 @@ module ActiveRecord
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