Skip to content

Commit

Permalink
Merge pull request #692 from rom-rb/fix-with-for-composite-relations
Browse files Browse the repository at this point in the history
Fix using .with on composite relations (fix #691)
  • Loading branch information
flash-gordon authored May 6, 2024
2 parents 2413b8f + 035f48e commit 5267aba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
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

0 comments on commit 5267aba

Please sign in to comment.