Skip to content

Commit

Permalink
Merge pull request carrierwaveuploader#2543 from muratiger/add_proces…
Browse files Browse the repository at this point in the history
…s_version_to_read_me

Add conditional process in README
  • Loading branch information
mshibuya committed Mar 16, 2021
2 parents 42c620a + c95b80f commit 3083c12
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,22 @@ created. This can cut down on processing cost.

See `carrierwave/processing/mini_magick.rb` for details.

### conditional process

If you want to use conditional process, you can only use `if` statement.

See `carrierwave/uploader/processing.rb` for details.

```ruby
class MyUploader < CarrierWave::Uploader::Base
process :scale => [200, 200], :if => :image?

def image?(carrier_wave_sanitized_file)
true
end
end
```

### Nested versions

It is possible to nest versions within versions:
Expand Down

0 comments on commit 3083c12

Please sign in to comment.