Module: Goldiloader::AssociationPatch

Extended by:
ActiveSupport::Concern
Defined in:
lib/goldiloader/active_record_patches.rb

Instance Method Summary collapse

Instance Method Details

#auto_include?Boolean

Returns:

  • (Boolean)


109
110
111
112
113
# File 'lib/goldiloader/active_record_patches.rb', line 109

def auto_include?
  # We only auto include associations that don't have in-memory changes since the
  # Rails association Preloader clobbers any in-memory changes
  !loaded? && target.blank? && eager_loadable?
end

#fully_load?Boolean

Returns:

  • (Boolean)


115
116
117
# File 'lib/goldiloader/active_record_patches.rb', line 115

def fully_load?
  !loaded? && options.fetch(:fully_load) { self.class.default_fully_load }
end