Skip to content

Commit 5267aba

Browse files
authored
Merge pull request #692 from rom-rb/fix-with-for-composite-relations
Fix using .with on composite relations (fix #691)
2 parents 2413b8f + 035f48e commit 5267aba

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

changelog.yml

+4
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@
9494
rather than `:default` so that we can detect when it was not specified and act
9595
accordingly. This will only make sense when there's just *one adapter available*
9696
(via bedb330f0ec195d9acacf4481dad3a705e8a36af) (@solnic)"
97+
- version: 5.3.2
98+
date: '2024-05-06'
99+
fixed:
100+
- "[rom-core] another fix caused by `Object#with` from ActiveSupport 7.1 (@flash-gordon)"
97101
- version: 5.3.1
98102
date: '2024-03-15'
99103
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? respond_to_missing?].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)