views:

89

answers:

2

Is possible set 2 methods on before_validation in a model?

before_validation :elaborate
  before_validation :download_remote_data, :if => :data_url_provided?

Thanks

+2  A: 

That is certainly valid. You can add as many before_validation calls as you need.

Thomas Brice
+3  A: 

Yes, your code is fine. Just have in mind that elaborate method is going to be executed first (since it's registered before the download_remote_data method).

Milan Novota
Good catch with the conditional callback. I've removed my answer as it doesn't add anything new.
EmFi