module Goldiloader::BasePatch
Attributes
auto_include_context[W]
Public Instance Methods
auto_include_context()
click to toggle source
# File lib/goldiloader/active_record_patches.rb, line 20 def auto_include_context @auto_include_context ||= Goldiloader::AutoIncludeContext.new.register_model(self) end
goldiload(cache_name = nil, key: self.class.primary_key, &block)
click to toggle source
# File lib/goldiloader/active_record_patches.rb, line 29 def goldiload(cache_name = nil, key: self.class.primary_key, &block) cache_name ||= block.source_location.join(':') auto_include_context.preloaded(self, cache_name: cache_name, key: key, &block) end
initialize_copy(other)
click to toggle source
Calls superclass method
# File lib/goldiloader/active_record_patches.rb, line 15 def initialize_copy(other) super @auto_include_context = nil end
reload(*)
click to toggle source
Calls superclass method
# File lib/goldiloader/active_record_patches.rb, line 24 def reload(*) @auto_include_context = nil super end