开发者

more methods for before_validation

开发者 https://www.devze.com 2022-12-12 11:16 出处:网络
Is possible set 2 methods on before_validation in a model? before_validation :elaborate before_validation :download_re开发者_JAVA百科mote_data, :if => :data_url_provided?

Is possible set 2 methods on before_validation in a model?

before_validation :elaborate
before_validation :download_re开发者_JAVA百科mote_data, :if => :data_url_provided? 


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).


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

0

精彩评论

暂无评论...
验证码 换一张
取 消