Skip to content

Instantly share code, notes, and snippets.

@pashagray
Created July 24, 2018 08:52
Show Gist options
  • Save pashagray/2b8f94b7d7e3da70cb9076ec607918c5 to your computer and use it in GitHub Desktop.
Save pashagray/2b8f94b7d7e3da70cb9076ec607918c5 to your computer and use it in GitHub Desktop.
Carrierwave fog recreate/reprocess
Photosession.all.each do |p|
p.photos.each do |ph|
begin
p.process_photos_upload = true
ph.cache_stored_file!
ph.retrieve_from_cache!(ph.cache_name)
ph.recreate_versions!(:xl, :l, :m, :s, :xs)
p.save!
rescue => e
puts "ERROR: YourModel: #{e.to_s}"
end
end;nil
end;nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment