Rails: validation that spans multiple models, where to put it?
- by randombits
I have a custom validation method that is exactly the same for two or more models. Where's the best place to put this validation method so that both models can access it and keep things DRY? If the validation fails, I also want to use errors.add_to_base, so wherever this method is put, I should be able to accommodate for that.