Sha256: 150ec0b04f5353d4b0de21c1bd02d5272ebb35eebab2ca958128c1fa07308867
Contents?: true
Size: 427 Bytes
Versions: 10
Compression:
Stored size: 427 Bytes
Contents
# make sure the product images directory exists FileUtils.mkdir_p "#{Rails.root}/public/spree/products/" Asset.all.each do |asset| filename = asset.attachment_file_name puts "-- Processing image: #{filename}\r" path = File.join(File.dirname(__FILE__), "spree/#{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
10 entries across 10 versions & 1 rubygems