lib/rom/repository.rb in rom-repository-2.0.2 vs lib/rom/repository.rb in rom-repository-5.0.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require 'dry/core/cache'
require 'dry/core/class_attributes'
require 'rom/initializer'
require 'rom/struct'
@@ -84,11 +86,11 @@
struct_namespace ROM::Struct
# @!attribute [r] container
# @return [ROM::Container] The container used to set up a repo
- param :container, allow: ROM::Container
+ option :container, allow: ROM::Container
# @!attribute [r] struct_namespace
# @return [Module,Class] The namespace for auto-generated structs
option :struct_namespace, default: -> { self.class.struct_namespace }
@@ -98,16 +100,13 @@
# @!attribute [r] relations
# @return [RelationRegistry] The relation proxy registry used by a repo
attr_reader :relations
- # Initializes a new repo by establishing configured relation proxies from
- # the passed container
+ # Initializes a new repository object
#
- # @param container [ROM::Container] The rom container with relations and optional commands
- #
# @api private
- def initialize(container, options = EMPTY_HASH)
+ def initialize(*)
super
@relations = {}
end
# Open a database transaction