aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorThorsten Ball <mrnugget@gmail.com>2014-11-28 13:34:38 +0100
committerThorsten Ball <mrnugget@gmail.com>2014-11-28 13:42:50 +0100
commit6405a03c1303c4c2da7029cf9199bd17451fec4d (patch)
treee1c811be2bd6686b8da2117f582d9353cf652e52 /activerecord/lib
parent2cdd229fc2a3848cf7d77ccb718544594e0373eb (diff)
downloadrails-6405a03c1303c4c2da7029cf9199bd17451fec4d.tar.gz
rails-6405a03c1303c4c2da7029cf9199bd17451fec4d.tar.bz2
rails-6405a03c1303c4c2da7029cf9199bd17451fec4d.zip
Adds preloaded_records method to NullPreloader
This fixes a regression where preloading association throws an exception if one of the associations in the preloading hash doesn't exist for one record. Fixes #16070
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/associations/preloader.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/preloader.rb b/activerecord/lib/active_record/associations/preloader.rb
index 46bccbf15a..4358f3b581 100644
--- a/activerecord/lib/active_record/associations/preloader.rb
+++ b/activerecord/lib/active_record/associations/preloader.rb
@@ -178,6 +178,7 @@ module ActiveRecord
class NullPreloader
def self.new(klass, owners, reflection, preload_scope); self; end
def self.run(preloader); end
+ def self.preloaded_records; []; end
end
def preloader_for(reflection, owners, rhs_klass)