Permalink
Browse files

Merge pull request #30914 from bogdanvlviv/active_record_basics-guide…

…s-add-destroy_all

Add mention how to delete several records in bulk to Active Record Basics Guides [ci skip]
  • Loading branch information...
eileencodes committed Oct 18, 2017
2 parents d7ee4f2 + 64b45b2 commit ded41a9b84299f536bc136d78069a50a2e867768
Showing with 11 additions and 0 deletions.
  1. +11 −0 guides/source/active_record_basics.md
@@ -304,6 +304,17 @@ user = User.find_by(name: 'David')
user.destroy
```
If you'd like to delete several records in bulk, you may use `destroy_all`
method:
```ruby
# find and delete all users named David
User.where(name: 'David').destroy_all
# delete all users
User.destroy_all
```
Validations
-----------

0 comments on commit ded41a9

Please sign in to comment.