Sha256: 47cce8fea38b0830d24c77428d9fbe3e56155ecec6903af3c01da19230c10378
Contents?: true
Size: 653 Bytes
Versions: 7
Compression:
Stored size: 653 Bytes
Contents
module ActiveRecord # This imitates EagerLoadPolymorphicError class EagerLoadCountLoaderError < ActiveRecordError def initialize(reflection) super("Cannot eagerly load the count_loader association #{reflection.name.inspect}") end end module CountLoader module JoinDependencyExtension def build(associations, base_klass) associations.map do |name, right| reflection = find_reflection base_klass, name if reflection.macro == :count_loader raise EagerLoadCountLoaderError.new(reflection) end end super(associations, base_klass) end end end end
Version data entries
7 entries across 7 versions & 1 rubygems