Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve README on recreate_versions! throwing an exception

  • Loading branch information...
commit b310fbf1a1cca4cf4b6e155193627512d230c8e8 1 parent 95e7c28
@rin rin authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 README.md
View
8 README.md
@@ -448,6 +448,14 @@ User.all.each do |user|
end
```
+Note: `recreate_versions!` will throw an exception on records without an image. To avoid this, scope the records to those with images or check if an image exists within the block. If you're using ActiveRecord, recreating versions for a user avatar might look like this:
+
+```ruby
+User.all.each do |user|
+ user.avatar.recreate_versions! if user.avatar?
+end
+```
+
## Configuring CarrierWave
CarrierWave has a broad range of configuration options, which you can configure,
Please sign in to comment.
Something went wrong with that request. Please try again.