在使用update_attribute方法时,不走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

相关文章:

  • 2022-12-23
  • 2021-07-29
  • 2021-08-12
  • 2021-11-29
  • 2021-09-10
  • 2021-09-29
  • 2021-07-02
  • 2021-09-29
猜你喜欢
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-15
  • 2021-07-27
相关资源
相似解决方案