Module: ActiveRecord::Temporal::Patches::AssociationReflection

Defined in:
lib/activerecord/temporal/patches/association_reflection.rb

Overview

This permits association scopes generated by this gem to be eager-load if they are "optionally instance-dependent." That is to say, they accept but don't require arguments.

I think permitting eager-loading of such scopes would make sense as a standalone feature for Active Record. See this PR for my justification: https://github.com/rails/rails/pull/56004

Instance Method Summary collapse

Instance Method Details

#check_eager_loadable!Object



11
12
13
# File 'lib/activerecord/temporal/patches/association_reflection.rb', line 11

def check_eager_loadable!
  super unless temporal_scope? && scope_requires_no_params?
end