X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/bed9cd00ed166ce346da4b8a9b654ddf86e64e70..0d187c5c711c5381872c21309fa74087b4896c49:/db/migrate/004_user_enhancements.rb diff --git a/db/migrate/004_user_enhancements.rb b/db/migrate/004_user_enhancements.rb index a6e81d222..af4b65123 100644 --- a/db/migrate/004_user_enhancements.rb +++ b/db/migrate/004_user_enhancements.rb @@ -1,3 +1,5 @@ +require 'migrate' + class UserEnhancements < ActiveRecord::Migration def self.up add_column "diary_entries", "latitude", :double @@ -22,7 +24,7 @@ class UserEnhancements < ActiveRecord::Migration add_index "user_tokens", ["token"], :name => "user_tokens_token_idx", :unique => true add_index "user_tokens", ["user_id"], :name => "user_tokens_user_id_idx" - User.find(:all, :conditions => "token is not null").each do |user| + User.where("token is not null").each do |user| UserToken.create(:user_id => user.id, :token => user.token, :expiry => 1.week.from_now) end