Closed timriley closed 5 years ago
This seems to work in #548
[ruby-2.6.3][node-v8.12.0] git(547-fix-dupped-combine)
➜ rom be ruby tmp/repros/547.rb
[#<ROM::Struct::Charge id=1 credit_card_purchase_charge=#<ROM::Struct::CreditCardPurchaseCharge charge_id=1 card_name="Jane Card">>]
Describe the bug
Running a query built by calling the same
combine
method called twice causes an error from within tranproc's combine (while trying to map the output).To Reproduce
Fire up Postgres,
createdb rom_bug_repro
, and then run this script.To see it work properly, comment out one of the
.combine(:credit_card_purchase_charge)
lines at the end, and the query completes.It's not normal to have 2 identical combines chained like this, but in a large app, where they may be spread around different relation methods, it's indeed possible (this issue came from a real app of mine).
Output according to script above:
Output when commenting out one of the combines:
Expected behavior
The second combine is ignored or gracefully handled in some way, and the actual results are returned.
Your environment
n/a