Build your own Ruby on Rails validations and use them like the default ones
Sometimes built in validations are not enough so we have to write our own validation rules. Because of this, our models can become fat really quick so the best idea to avoid it is to extract validation logic to separated classes. Such approach makes the code more clean, isolated and reusable - http://pdabrowski.com/blog/ruby-on-rails/validations/building-custom-validator/
Post a comment