lib/rom/sql/plugin/associates.rb in rom-sql-1.2.1 vs lib/rom/sql/plugin/associates.rb in rom-sql-1.2.2

- old
+ new

@@ -55,12 +55,12 @@ include InstanceMethods defines :associations associations Hash.new - option :associations, reader: true, optional: true, default: -> cmd { cmd.class.associations } - option :configured_associations, reader: true, optional: true, default: proc { [] } + option :associations, default: -> { self.class.associations } + option :configured_associations, default: -> { EMPTY_ARRAY } end super end module ClassMethods @@ -168,10 +168,12 @@ end # @api public def with_association(name, opts = EMPTY_HASH) self.class.build( - relation, options.merge(associations: associations.merge(name => opts)) + relation, + **options, + associations: associations.merge(name => opts) ) end # @api private def __registry__