How do I find out why I couldn't #destroy() a record?

前端 未结 5 1163
陌清茗
陌清茗 2021-02-01 15:16
person = Person.find(4123)
person.destroy #=> false

What ways do I have to find out why the record wasn\'t deleted? The model has two validations, b

5条回答
  •  失恋的感觉
    2021-02-01 15:40

    You should add some debug information e.g. logger.debug and look at your log files. e.g. log/production.log if running in production mode and etc and you should be able to find out why. If not, you can post the relevant log file section (e.g. the action you are running) up here and we can help you out.

提交回复
热议问题