Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix using .with on composite relations (fix #691) #692

Merged
merged 2 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
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? 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
Expand Down
Loading