Popularity
0.7
Growing
Activity
0.0
Stable
7
3
1

Description

A small gem that helps to delete an ActiveRecord instance or collection with associations (skipping callbacks or validations)

Monthly Downloads: 50
Programming language: Ruby
License: MIT License

vandal alternatives and similar gems

Based on the "ORM/ODM Extensions" category.
Alternatively, view vandal alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of vandal or a related project?

Add another 'ORM/ODM Extensions' Gem

README

Gem Version CircleCI

A small gem that helps to delete an ActiveRecord instance or collection with associations (skipping callbacks or validations)

Installation

Add this line to your application's Gemfile and then execute bundle install

gem 'vandal'

Usage

Vandal gem adds 2 methods to ActiveRecord::Base

#vandal_destroy

Delete an ActiveRecord instance with associations even if the callbacks return false or rescue error.

class User
  has_many :followers # Does not even contain dependent: :destroy
end

User.find_by(id: 1).vandal_destroy

Followers will deleted along with User.

#vandal_destroy_all

Applies vandal_destroy for ActiveRecord collection

User.all.vandal_destroy_all

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kirillshevch/vandal.

License

The gem is available as open source under the terms of the MIT License.


*Note that all licence references and agreements mentioned in the vandal README section above are relevant to that project's source code only.