diff --git a/lib/tasks/user_login.rake b/lib/tasks/user_login.rake index 59e861b98..31dfbb2b4 100644 --- a/lib/tasks/user_login.rake +++ b/lib/tasks/user_login.rake @@ -13,10 +13,13 @@ namespace :user do login = "#{base_login}#{no}" puts no puts login - user.login = login - user.lastname = login - user.nickname = login - user.save + + sql1 = "update users set login='#{login}' where id=#{user.id}" + sql2 = "update users set lastname='#{login}' where id=#{user.id}" + sql3 = "update users set nickname='#{login}' where id=#{user.id}" + ActiveRecord::Base.connection.execute(sql1) + ActiveRecord::Base.connection.execute(sql2) + ActiveRecord::Base.connection.execute(sql3) end rescue Exception => e Rails.logger.error(e.message)