Last active
December 19, 2015 00:09
-
-
Save leemour/5866407 to your computer and use it in GitHub Desktop.
Pass a file to Rails Console. Recreate versons of images with Carrierwave
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bundle exec rails runner "eval(File.read 'lib/scripts/recreate_versions.rb')" | |
Product.all.each do |p| | |
%w(photo1 photo2 photo3 photo4 photo5).map(&:to_sym).each do |photo| | |
p.send(photo).recreate_versions! if p.read_attribute(photo).present? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment