rom-rb / rom

Data mapping and persistence toolkit for Ruby
https://rom-rb.org
MIT License
2.09k stars 161 forks source link

TupleCountMismatchError when incorrect mapper is used #344

Closed solnic closed 7 years ago

solnic commented 8 years ago

We have an unfortunate behavior when a mapper that doesn't transform relation graphs is used to map a relation graph, the outcome is that when hitting .one on the relation you get an error telling you that there were more than 1 result, it happens because the mapper didn't map the relation and passed down an array with two tuple sets (result from a relation graph).

No idea how to solve this yet, probably needs mappers with explicit arity specified so that we can apply proper arg validation and raise meaningful errors.

solnic commented 7 years ago

Not going to address this after all. Custom mappers are advanced usage after all.