From db84d635b5c2183f2d0ddbc4dd8dc2cf7e14f4b3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 29 Jul 2019 16:46:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20190729080935_modify_login_for_users.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/20190729080935_modify_login_for_users.rb b/db/migrate/20190729080935_modify_login_for_users.rb index e8beb49fe..274e163de 100644 --- a/db/migrate/20190729080935_modify_login_for_users.rb +++ b/db/migrate/20190729080935_modify_login_for_users.rb @@ -2,8 +2,8 @@ class ModifyLoginForUsers < ActiveRecord::Migration[5.2] def change users = User.where("created_on > '2019-07-26 19:00:00'") users.find_each do |use| - use.update_attributes(:login, use.login.strip, phone: use.phone.try(:strip)) - use.user_extension.update_column(:student_id,use.user_extension.student_id.try(:strip)) + use.update_attributes(login: use.login.strip, phone: use.phone.try(:strip)) + use.user_extension.update_column(:student_id, use.user_extension.student_id.try(:strip)) end end end