diff --git a/db/migrate/20111010173231_update_twitter_urls_for_https.rb b/db/migrate/20111010173231_update_twitter_urls_for_https.rb new file mode 100644 index 00000000000..b01529e7f18 --- /dev/null +++ b/db/migrate/20111010173231_update_twitter_urls_for_https.rb @@ -0,0 +1,14 @@ +class UpdateTwitterUrlsForHttps < ActiveRecord::Migration + def self.up + while true + users = User.find(:all, :conditions => "avatar_image_source='twitter' AND avatar_image_url NOT LIKE 'https%'", :limit => 500).each do |u| + u.avatar_image = { 'type' => 'twitter' } + u.save! + end + break if users.empty? + end + end + + def self.down + end +end