Sha256: 5c57a2fe2d13949307e0083d8f80045ce029f44e60df129e960ed9815c485eaf
Contents?: true
Size: 437 Bytes
Versions: 34
Compression:
Stored size: 437 Bytes
Contents
# make sure the product images directory exists FileUtils.mkdir_p "#{Rails.root}/public/spree/products/" Spree::Asset.all.each do |asset| filename = asset.attachment_file_name puts "-- Processing image: #{filename}\r" path = File.join(File.dirname(__FILE__), "products/#{filename}") if FileTest.exists? path asset.attachment = File.open(path) asset.save else puts "--- Could not find image at: #{path}" end end
Version data entries
34 entries across 34 versions & 2 rubygems