Using wrap and combine in one relation fails.

Hey :waving_hand: ,

please checkout following use-case:

following usage of wrap works perfectly

app["relations.documents"].wrap(:document_state).to_a

following usage of combine works perfectly:

app[“relations.documents”].combine(:document_logs).to_a

the combination of both fails unfortunately.

app[“relations.documents”].wrap(:document_state).combine(:document_logs).to_a
/usr/local/bundle/gems/rom-core-5.4.0/lib/rom/relation/combined.rb:23:in ‘new’: wrong number of arguments (given 3, expected 2) (ArgumentError)
from /usr/local/bundle/gems/rom-core-5.4.0/lib/rom/initializer.rb:37:in ‘ROM::Relation::Graph#with’
from /usr/local/bundle/gems/rom-core-5.4.0/lib/rom/relation/wrap.rb:32:in ‘ROM::Relation::Wrap#call’
from /usr/local/bundle/gems/rom-core-5.4.0/lib/rom/relation/materializable.rb:14:in ‘ROM::Relation::Materializable#to_a’
from (irb):24:in ‘’from internal:kernel:168:in ‘Kernel#loop’
from /usr/local/bundle/gems/hanami-cli-2.2.1/lib/hanami/cli/commands/app/console.rb:48:in ‘Hanami::CLI::Commands::App::Console#call’
from /usr/local/bundle/gems/hanami-cli-2.2.1/lib/hanami/cli/commands/app/command.rb:46:in ‘Hanami::CLI::Commands::App::Command::Environment#call’
from /usr/local/bundle/gems/dry-cli-1.3.0/lib/dry/cli.rb:117:in ‘Dry::CLI#perform_registry’
from /usr/local/bundle/gems/dry-cli-1.3.0/lib/dry/cli.rb:66:in ‘Dry::CLI#call’
from bin/hanami:75:in ‘’

Is this expected not to work, or is this a bug. Making it work would be a standout feature :fire:

thanks

Thanks for sharing this, @wuarmin. This is a known issue: Wrap plus combine fails · Issue #295 · rom-rb/rom-sql · GitHub

If you’d like to have a go at working on this, I’d be happy to support you however I can :slight_smile:

1 Like

All right!
I would love to dive into things like that :star_struck: , investigate, and learn more. At the moment, time is short. If it’s possible, I will delve deeper into this topic.