之前有一篇文章写到,在使用update_attribute方法时,不走validation,通过从官网上查阅,将走validation和不走的方法总结归纳如下:
走validation的方法:
- create
- create!
- save
- save!
- update
- update_attributes
- update_attributes!
跳过validation的方法:
decrement! decrement_counter increment! increment_counter toggle! touch update_all update_attribute update_column update_counters