lib/hanami/model.rb in hanami-model-0.7.0 vs lib/hanami/model.rb in hanami-model-1.0.0.beta1

- old
+ new

@@ -15,11 +15,11 @@ require 'hanami/model/mapping' require 'hanami/model/plugins' # @api private # @since 0.7.0 - @__repositories__ = Concurrent::Array.new # rubocop:disable Style/VariableNumber + @__repositories__ = Concurrent::Array.new class << self # @since 0.7.0 # @api private attr_reader :config @@ -70,17 +70,11 @@ raise 'Not loaded' unless loaded? @container end # @since 0.1.0 - def self.load!(&blk) # rubocop:disable Metrics/AbcSize - configuration.setup.auto_registration(config.directory.to_s) unless config.directory.nil? - configuration.instance_eval(&blk) if block_given? - repositories.each(&:load!) - - @container = ROM.container(configuration) - configuration.define_entities_mappings(@container, repositories) - - @loaded = true + def self.load!(&blk) + @container = configuration.load!(repositories, &blk) + @loaded = true end end end