Sha256: 15a2e20a413884e70874e4e4909ee2ad188ae0f9282db5ec12660dd3894f3b97

Contents?: true

Size: 490 Bytes

Versions: 2

Compression:

Stored size: 490 Bytes

Contents

# encoding: UTF-8

module Goldiloader
  class AutoIncludeContext < Struct.new(:model_registry, :association_path)
    def self.create_empty
      Goldiloader::AutoIncludeContext.new(Goldiloader::ModelRegistry.new, [])
    end

    def register_models(models)
      Array.wrap(models).each do |model|
        model.auto_include_context = self
        model_registry.register(model, association_path)
      end
      self
    end

    alias_method :register_model, :register_models
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
goldiloader-0.0.4 lib/goldiloader/auto_include_context.rb
goldiloader-0.0.3 lib/goldiloader/auto_include_context.rb