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