Skip to content

Instantly share code, notes, and snippets.

@agibralter
Created September 24, 2008 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agibralter/12666 to your computer and use it in GitHub Desktop.
Save agibralter/12666 to your computer and use it in GitHub Desktop.
has_many | ... | :dependent => :destroy | :dependent => :delete_all
---------------------------------------------------------------------------------------------------
@post.clear | doesn't delete in db | destroy on each record | 1 DELETE (no callbacks, etc.)
@post.destroy_all | doesn't delete in db | destroy on each record | destroy on each record
@post.delete_all | doesn't delete in db | destroy on each record | 1 DELETE (no callbacks, etc.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment