I'm writing a Rails app to manage a series of banners along the top of our website; each one should link either to a URL provided by the editor, or a specific product selected from a drop-down list.
I'd like to put some kind of validation in the model, for consistency with other checks, that makes sure one (but not both) of the fields (product ID or URL) has been provided when saving.
Is there a validates-type way to check this, or will I have to put this check somewhere in the controller instead?