Delete command on relation should return all deleted entities

According to the code comments, the delete command should return the deleted entities. However, they return one.

relation.changeset(:create, {id: 1}, {id:  2}, {id: 3}).commit

result = relation.command(:delete).call
# => #<ROM::Struct::Event id="1">

That should be an array of all 3 entities, correct?

Hmm, does it work when you do relation.command(:delete, result: :many).call?

Hi @solnic - that solved it. However, it’s odd that the source describes and implies a different result?

@solnic I found today that relation.command(:delete, result: nil).call also returns an array as is expected based on the source code. For some reason, there is a behavioral difference between specifying nil and completely omitting the option altogether.

This is helpful! When delete is returning entities is it possible to have them return a custom representation other than ROM:Struct or plain hash?