When to use `save` vs `save!` in model?

前端 未结 3 1688
予麋鹿
予麋鹿 2020-12-23 11:17

According to save bang your head, active record will drive you mad, we should avoid using save! and rescue idiom for exceptional situations. Given

3条回答
  •  渐次进展
    2020-12-23 11:37

    save! will raise an error if not successful.

    save will return boolean value like true or false.

提交回复
热议问题