From abd88afc6e13b03996ae11265fa698af52f22a99 Mon Sep 17 00:00:00 2001 From: Nikita Shilnikov Date: Mon, 6 May 2024 18:40:43 +0200 Subject: [PATCH 1/2] Fix using .with on composite relations (fix #691) --- lib/rom/pipeline.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/rom/pipeline.rb b/lib/rom/pipeline.rb index 14d65db8a..914b4331c 100644 --- a/lib/rom/pipeline.rb +++ b/lib/rom/pipeline.rb @@ -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? respond_to_missing?].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 From 035f48e7d68a1e52d64910c7a4921e31bf33b65e Mon Sep 17 00:00:00 2001 From: Nikita Shilnikov Date: Mon, 6 May 2024 18:48:52 +0200 Subject: [PATCH 2/2] Update changelog --- changelog.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog.yml b/changelog.yml index d9fd74992..b5ba455fd 100644 --- a/changelog.yml +++ b/changelog.yml @@ -94,6 +94,10 @@ rather than `:default` so that we can detect when it was not specified and act accordingly. This will only make sense when there's just *one adapter available* (via bedb330f0ec195d9acacf4481dad3a705e8a36af) (@solnic)" +- version: 5.3.2 + date: '2024-05-06' + fixed: + - "[rom-core] another fix caused by `Object#with` from ActiveSupport 7.1 (@flash-gordon)" - version: 5.3.1 date: '2024-03-15' changed: