Skip to content

Commit

Permalink
Fix using .with on composite relations (fix #691)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash-gordon committed May 6, 2024
1 parent 2413b8f commit c29d338
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/rom/pipeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,18 @@ def method_missing(name, *args, &block)
# Base composite class with left-to-right pipeline behavior
#
# @api private
class Composite
(Kernel.private_instance_methods - %i[respond_to_missing? block_given?])
.each(&method(:undef_method))
class Composite < ::BasicObject
%i[block_given?].each do |method|
define_method(method, ::Kernel.instance_method(method))
private method
end

%i[class to_s inspect is_a? instance_of? to_enum].each do |method|
define_method(method, ::Kernel.instance_method(method))
end

include Dry::Equalizer(:left, :right)
include Proxy
include ::Dry::Equalizer(:left, :right)
include ::ROM::Pipeline::Proxy

# @api private
attr_reader :left
Expand Down

0 comments on commit c29d338

Please sign in to comment.