Skip to content

Commit

Permalink
Remove existing with when mixing in Initializer (closes #684, #687)
Browse files Browse the repository at this point in the history
So that it doesn't clash with the new "feature" from AS, namely, Object#with
  • Loading branch information
flash-gordon committed Mar 15, 2024
1 parent 7fb82cf commit 6c1ed87
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/rom/initializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,13 @@ def with(**new_options)

# @api private
def self.extended(base)
base.extend(Dry::Initializer[undefined: false])
base.extend(DefineWithHook)
base.include(InstanceMethods)
base.module_eval do
undef_method(:with) if method_defined?(:with)

extend(Dry::Initializer[undefined: false])
extend(DefineWithHook)
include(InstanceMethods)
end
end

# @api private
Expand Down

0 comments on commit 6c1ed87

Please sign in to comment.