076_fix_users_empty_email.rb
上传用户:netsea168
上传日期:2022-07-22
资源大小:4652k
文件大小:0k
源码类别:

Ajax

开发平台:

Others

  1. class FixUsersEmptyEmail < ActiveRecord::Migration
  2.   def self.up
  3.       users = User.find(:all)
  4.       users.each do |user|
  5.         if user.email.empty?
  6.           user.email = "typo@typo"
  7.           user.save!
  8.         end
  9.       end
  10.   end
  11.   def self.down
  12.   end
  13. end