Skip to content

Commit 6c1ed87

Browse files
committed
Remove existing with when mixing in Initializer (closes #684, #687)
So that it doesn't clash with the new "feature" from AS, namely, Object#with
1 parent 7fb82cf commit 6c1ed87

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/rom/initializer.rb

+7-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,13 @@ def with(**new_options)
4747

4848
# @api private
4949
def self.extended(base)
50-
base.extend(Dry::Initializer[undefined: false])
51-
base.extend(DefineWithHook)
52-
base.include(InstanceMethods)
50+
base.module_eval do
51+
undef_method(:with) if method_defined?(:with)
52+
53+
extend(Dry::Initializer[undefined: false])
54+
extend(DefineWithHook)
55+
include(InstanceMethods)
56+
end
5357
end
5458

5559
# @api private

0 commit comments

Comments
 (0)