More methods for before_validation

Is it possible to set 2 methods on before_validation in the model?

before_validation :elaborate before_validation :download_remote_data, :if => :data_url_provided? 
+6
ruby-on-rails
source share
2 answers

Yes, your code is ok. Just keep in mind that a complex method will be executed first (since it registered before the download_remote_data method).

+9
source share

This is certainly true. You can add as many before_validation calls as you need.

+4
source share

All Articles