From 163d5519cbcb2cb841adba2f4a78d1aa2677a233 Mon Sep 17 00:00:00 2001 From: Daniel Gollahon Date: Wed, 27 Sep 2023 23:20:55 -0700 Subject: [PATCH] Fix `command(:create, result: :many)` for combines - In ruby 3.x the `result: :many` will get forwarded incorrectly if there is a `combine`. That is, something like `relation.command(:create, result: :many)` will work but `relation.combine(:child_relation).command(:create, result: :many)` will raise `ArgumentError: wrong number of arguments (given 2, expected 1)`. This fixes is it (I have tested by doing the following on my codebase `ROM::Relation::Combined.__send__(:ruby2_keywords, :command)`). --- lib/rom/relation/combined.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/rom/relation/combined.rb b/lib/rom/relation/combined.rb index 4c5c74eac..b3ac3632d 100644 --- a/lib/rom/relation/combined.rb +++ b/lib/rom/relation/combined.rb @@ -148,6 +148,7 @@ def command(type, *args) "#{self.class}#command doesn't work with #{type.inspect} command type yet" end end + ruby2_keywords(:command) if respond_to?(:ruby2_keywords, true) private