aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/preloader
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-09-24 14:57:15 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-09-24 14:57:15 -0700
commitc4e1fdd9b20020594135aaf5ae06ec1bec05df03 (patch)
treebc10b7b5a23d520766db262e57316947d9c5606c /activerecord/lib/active_record/associations/preloader
parente9d2ff6959f1e3fcd4fed1d18d8de575aa8d36e8 (diff)
downloadrails-c4e1fdd9b20020594135aaf5ae06ec1bec05df03.tar.gz
rails-c4e1fdd9b20020594135aaf5ae06ec1bec05df03.tar.bz2
rails-c4e1fdd9b20020594135aaf5ae06ec1bec05df03.zip
guarantee that `klass` is not nil inside the preloader objects
Diffstat (limited to 'activerecord/lib/active_record/associations/preloader')
-rw-r--r--activerecord/lib/active_record/associations/preloader/association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/preloader/association.rb b/activerecord/lib/active_record/associations/preloader/association.rb
index d02384e221..63161d9744 100644
--- a/activerecord/lib/active_record/associations/preloader/association.rb
+++ b/activerecord/lib/active_record/associations/preloader/association.rb
@@ -86,7 +86,7 @@ module ActiveRecord
h[owner] = []
end
- if klass && owner_keys.any?
+ if owner_keys.any?
# Some databases impose a limit on the number of ids in a list (in Oracle it's 1000)
# Make several smaller queries if necessary or make one query if the adapter supports it
sliced = owner_keys.each_slice(klass.connection.in_clause_length || owner_keys.size)