Modernise use of find and update_all in database migrations

This commit is contained in:
Tom Hughes 2014-04-25 00:41:39 +01:00
parent 1a38e9b315
commit 360333d37d
6 changed files with 13 additions and 13 deletions

View file

@ -24,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