Sha256: d3366f04ec1bf4c40415238637582589b311b47dad6f9f0538400cd47210aa00

Contents?: true

Size: 1.74 KB

Versions: 1

Compression:

Stored size: 1.74 KB

Contents

# Paperclip::PermanentRecords

When using permanent_records, paperclip attachments should only be deleted
when the model is really destroyed.

See [paperclip #804](https://github.com/thoughtbot/paperclip/issues/804#issuecomment-4946231).

## Compatibility

* rails 5.2: works with paperclip 6.x and ruby 2.5 or later
* tested with permanent_records 5.0.0
* previous versions of ruby/rails/paperclip: please check version 0.4.x of this gem

Please see `.travis.yml` and `Appraisals` for what combinations have actually been tested. Usage with other versions
might cause data loss.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'paperclip-permanent_records'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install paperclip-permanent_records

## Usage

Nothing to do, this should just work.

## How does it work?

This gem does basically two things:

* prevent paperclip from marking attachments to be deleted in paperclip's `before_destroy` callback(s)
  (by patching paperclip)
* mark attachments to be deleted in the model's `destroy` method
  (depending on whether the model is actually destroyed or only deleted)

## Development

Code style: Please use rubocop before you commit (`bundle exec rubocop`) and fix any warnings.

To setup tests, make sure all the ruby versions defined in `.travis.yml` are installed on your system. 
Use `bundle exec appraisal generate` to generate the gemfiles if you change them in `Appraisals` and `.travis.yml`.

Run tests via:

* `rake wwtd` for all combinations of ruby/rails/paperclip versions
* `rake wwtd:local` for all rails/paperclip versions, but only on current ruby
* `rake spec` (or e.g. `bundle exec rspec spec --format documentation`) with main Gemfile and only on current ruby

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
paperclip-permanent_records-0.5.0 README.md