Created
July 3, 2015 10:02
-
-
Save beck03076/3e7f37506d32dc94b9bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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