{"provider_name":"Hatena Blog","version":"1.0","image_url":null,"type":"rich","title":"binding.pry\u3067\u30c7\u30d0\u30c3\u30b0\u4e2d\u306b\u3001\u610f\u56f3\u7684\u306b\u4f8b\u5916\u3092\u767a\u751f\u3055\u305b\u3066rescue\u3067\u30ad\u30e3\u30c3\u30c1\u3059\u308b\u65b9\u6cd5 #Rails5","url":"https://www.yokoyan.net/entry/2018/11/09/180000","author_name":"yokoyantech","blog_title":"\u7d19\u4e00\u91cd\u306e\u7a4d\u307f\u91cd\u306d","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.yokoyan.net%2Fentry%2F2018%2F11%2F09%2F180000\" title=\"binding.pry\u3067\u30c7\u30d0\u30c3\u30b0\u4e2d\u306b\u3001\u610f\u56f3\u7684\u306b\u4f8b\u5916\u3092\u767a\u751f\u3055\u305b\u3066rescue\u3067\u30ad\u30e3\u30c3\u30c1\u3059\u308b\u65b9\u6cd5 #Rails5 - \u7d19\u4e00\u91cd\u306e\u7a4d\u307f\u91cd\u306d\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%","published":"2018-11-09 18:00:00","blog_url":"https://www.yokoyan.net/","provider_url":"https://hatena.blog","categories":["Rails","ruby"],"author_url":"https://blog.hatena.ne.jp/yokoyantech/","description":"\u3084\u308a\u305f\u3044\u3053\u3068 binding.pry\u3067\u30c7\u30d0\u30c3\u30b0\u4e2d\u306b\u3001rescue\u3067\u5b9f\u88c5\u3057\u305f\u4f8b\u5916\u51e6\u7406\u3092\u78ba\u8a8d\u3057\u305f\u3044\u3002 \u5b9f\u73fe\u65b9\u6cd5 raise\u3092\u4f7f\u3046\u3002 \u5b9f\u88c5\u4f8b def update @hoge ||= hoge ApplicationRecord.transaction do binding.pry # \u4f8b\u5916\u767a\u751f raise ActiveRecord::RecordInvalid.new(@hoge) @hoge.update!(hoge_params) end redirect_to_edit_hoge_path rescue ActiveRecord::RecordInvalid binding.pry rend\u2026"}