Permalink
Browse files

Improve README on recreate_versions! throwing an exception

  • Loading branch information...
1 parent 95e7c28 commit b310fbf1a1cca4cf4b6e155193627512d230c8e8 @rin rin committed Dec 2, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 README.md
View
@@ -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,

0 comments on commit b310fbf

Please sign in to comment.