Answers

Question and Answer:

  Home  Ruby on Rails Developer

⟩ Tell me what’s the difference between destroy and delete?

Both of these methods delete the record in the database. The different between them is that:

☛ destroy – checks and deletes connected records if necessary and calls callbacks i.e. before_destroy, after_destroy etc.

☛ delete – doesn’t call callbacks and removes an object directly from the database.

 194 views

More Questions for you: