Sha256: 3cd51c58ff11b1fb4c14f37ffdac13b646a73303b5accec7a572bfb5a1076c64

Contents?: true

Size: 239 Bytes

Versions: 26

Compression:

Stored size: 239 Bytes

Contents

# frozen_string_literal: true

module ArLazyPreload
  # ActiveRecord::Association patch with a hook for lazy preloading
  module Association
    def load_target
      owner.try_preload_lazily(reflection.name)
      super
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
ar_lazy_preload-2.1.0 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-2.0.0 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-1.1.2 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-1.1.1 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-1.1.0 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-1.0.0 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-0.7.0 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-0.6.2 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-0.6.1 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-0.6.0 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-0.5.2 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-0.5.1 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-0.5.0 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-0.4.0 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-0.3.2 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-0.3.1 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-0.3.0 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-0.2.7 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-0.2.6 lib/ar_lazy_preload/active_record/association.rb
ar_lazy_preload-0.2.5 lib/ar_lazy_preload/active_record/association.rb