Sha256: 18dbffcba34a7a754d01cef0ad0460e045053cbca5bded941572f91c4f846a3d
Contents?: true
Size: 533 Bytes
Versions: 9
Compression:
Stored size: 533 Bytes
Contents
# frozen_string_literal: true module ArLazyPreload # ActiveRecord::Base patch with lazy preloading support module Base def self.included(base) base.class.delegate :lazy_preload, to: :all base.class.delegate :preload_associations_lazily, to: :all end attr_accessor :lazy_preload_context delegate :try_preload_lazily, to: :lazy_preload_context, allow_nil: true def skip_preload lazy_preload_context&.records&.delete(self) self.lazy_preload_context = nil self end end end
Version data entries
9 entries across 9 versions & 1 rubygems