In rails, how can I find out what caused a .save() to fail, other than validation errors?

前端 未结 5 1305
天涯浪人
天涯浪人 2020-12-24 11:18

I have an ActiveRecord model which is returning true from valid? (and .errors is empty), but is returning false from save()

5条回答
  •  北海茫月
    2020-12-24 11:53

    Try using the bang version save! (with an exclamation mark at the end) and inspecting the resulting error.

提交回复
热议问题