Skip to content

Instantly share code, notes, and snippets.

@beck03076
Created July 3, 2015 10:02
Show Gist options
  • Save beck03076/3e7f37506d32dc94b9bc to your computer and use it in GitHub Desktop.
Save beck03076/3e7f37506d32dc94b9bc to your computer and use it in GitHub Desktop.
def migrator(str,w,h)
if str.include?('dpjnlniaq')
@count += 1
puts "==========="
puts str
response = Cloudinary::Uploader.upload(str, :use_filename => true, :unique_filename => false, width: w, height: h)
puts response
puts "==========="
else
puts "not senthils cloud"
end
puts "### Now in #{@count} ##################"
end
@count = 1
Image.where('id > 1812').each do |i|
str = "original"
w = str + "_width"
h = str + "_height"
puts "------ #{str} --------"
puts "width: #{i.send(w)}"
puts "height: #{i.send(h)}"
migrator(i.send(str),w,h)
puts "------ #{str} --------"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment