Sha256: cc6dad6b4f284fb67573415bfb087a723c398c01f4f93430ce82f4f20d0bd94e

Contents?: true

Size: 538 Bytes

Versions: 11

Compression:

Stored size: 538 Bytes

Contents

# frozen_string_literal: true

module Goldiloader
  module AssociationOptions
    extend self

    OPTIONS = [:fully_load].freeze

    # This is only used in Rails 5+
    module AssociationBuilderExtension
      def self.build(model, reflection)
        # We have no callbacks to register
      end

      def self.valid_options
        OPTIONS
      end
    end

    def register
      ActiveRecord::Associations::Builder::Association.extensions << AssociationBuilderExtension
    end
  end
end

Goldiloader::AssociationOptions.register

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
goldiloader-4.2.1 lib/goldiloader/association_options.rb
goldiloader-5.2.1 lib/goldiloader/association_options.rb
goldiloader-5.2.0 lib/goldiloader/association_options.rb
goldiloader-5.1.0 lib/goldiloader/association_options.rb
goldiloader-5.0.0 lib/goldiloader/association_options.rb
goldiloader-4.2.0 lib/goldiloader/association_options.rb
goldiloader-4.1.2 lib/goldiloader/association_options.rb
goldiloader-4.1.1 lib/goldiloader/association_options.rb
goldiloader-4.1.0 lib/goldiloader/association_options.rb
goldiloader-4.0.1 lib/goldiloader/association_options.rb
goldiloader-4.0.0 lib/goldiloader/association_options.rb