Sha256: ea60db70dcaf7eb4b0583f0e9113ab120e0b137462131dc5b02c230f02953e2b

Contents?: true

Size: 973 Bytes

Versions: 1

Compression:

Stored size: 973 Bytes

Contents

# Vandal

A small gem that help 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`

```ruby
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.

```ruby
class User
  has_many :followers # Does not 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

```ruby
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](https://opensource.org/licenses/MIT).

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vandal-0.0.1 README.md