Module: Goldiloader::AutoIncludableModel

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

Instance Method Summary collapse

Instance Method Details

#auto_include_contextObject



16
17
18
# File 'lib/goldiloader/active_record_patches.rb', line 16

def auto_include_context
  @auto_include_context ||= Goldiloader::AutoIncludeContext.new.register_model(self)
end

#initialize_copy(other) ⇒ Object



11
12
13
14
# File 'lib/goldiloader/active_record_patches.rb', line 11

def initialize_copy(other)
  super
  @auto_include_context = nil
end

#reloadObject



20
21
22
23
# File 'lib/goldiloader/active_record_patches.rb', line 20

def reload(*)
  @auto_include_context = nil
  super
end