0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

保存失敗でエラーが出ない

Posted at

強制的にエラーを出す

〇〇.model.erb
purchase = Purchase.create!

保存できていないが、エラーも出ない状況で試すコード "!"
これを記述すると強制的にエラーが出るようになります。

似た機能として

ruby on railsやJavaScriptでは

〇〇.rb
binding.pry 
〇〇.js
console.log

などを使用して情報が取得できているか確認できます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?