Skip to content

Commit c29d338

Browse files
committed
Fix using .with on composite relations (fix #691)
1 parent 2413b8f commit c29d338

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

lib/rom/pipeline.rb

+11-5
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,18 @@ def method_missing(name, *args, &block)
8181
# Base composite class with left-to-right pipeline behavior
8282
#
8383
# @api private
84-
class Composite
85-
(Kernel.private_instance_methods - %i[respond_to_missing? block_given?])
86-
.each(&method(:undef_method))
84+
class Composite < ::BasicObject
85+
%i[block_given?].each do |method|
86+
define_method(method, ::Kernel.instance_method(method))
87+
private method
88+
end
89+
90+
%i[class to_s inspect is_a? instance_of? to_enum].each do |method|
91+
define_method(method, ::Kernel.instance_method(method))
92+
end
8793

88-
include Dry::Equalizer(:left, :right)
89-
include Proxy
94+
include ::Dry::Equalizer(:left, :right)
95+
include ::ROM::Pipeline::Proxy
9096

9197
# @api private
9298
attr_reader :left

0 commit comments

Comments
 (0)