Sha256: ef9811bb69c2fa13f0e87675be2cc089b7707b69845d4156021587d6da3f6c82

Contents?: true

Size: 460 Bytes

Versions: 9

Compression:

Stored size: 460 Bytes

Contents

# frozen_string_literal: true

module ActiveRecordDataLoader
  module Dsl
    class Definition
      attr_reader :models

      def initialize(config = ActiveRecordDataLoader.configuration)
        @models = []
        @config = config
      end

      def model(klass, &block)
        t = Model.new(klass: klass, configuration: config)
        block&.call(t)
        models << t
        t
      end

      private

      attr_reader :config
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
active_record_data_loader-1.3.1 lib/active_record_data_loader/dsl/definition.rb
active_record_data_loader-1.3.0 lib/active_record_data_loader/dsl/definition.rb
active_record_data_loader-1.2.0 lib/active_record_data_loader/dsl/definition.rb
active_record_data_loader-1.1.0 lib/active_record_data_loader/dsl/definition.rb
active_record_data_loader-1.0.2 lib/active_record_data_loader/dsl/definition.rb
active_record_data_loader-1.0.1 lib/active_record_data_loader/dsl/definition.rb
active_record_data_loader-1.0.0 lib/active_record_data_loader/dsl/definition.rb
active_record_data_loader-0.1.2 lib/active_record_data_loader/dsl/definition.rb
active_record_data_loader-0.1.1 lib/active_record_data_loader/dsl/definition.rb