I need to validate a value with data from an external API. The easiest way would be to add a validation rule in my model, call the external API and do my check.
But it feels very dirty to call an API within my model. (Also a lot of specs would fail due to missing api call mock).
What other options do I have within the normal rails stack?
What other options would I have, given I have a more complex model layer, such as service objects, repositories, etc.