From 99159ebf140e8f4a6cecf313dfeda865ac293697 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Tue, 17 Mar 2020 11:59:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/sync_forge_job.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/jobs/sync_forge_job.rb b/app/jobs/sync_forge_job.rb index f87af0b..2338c28 100644 --- a/app/jobs/sync_forge_job.rb +++ b/app/jobs/sync_forge_job.rb @@ -18,8 +18,8 @@ class SyncForgeJob < ApplicationJob ActiveRecord::Base.transaction do begin user_params = user_params["user"] if old_version_source.include?(platform) - Watcher&.where(user_id: user_params["user_id"]).update_all(user_id: new_user.id) - ProjectTrend&.where(user_id: user_params["user_id"]).update_all(user_id: new_user.id) + Watcher&.where(user_id: user_params["id"]).update_all(user_id: new_user.id) + ProjectTrend&.where(user_id: user_params["id"]).update_all(user_id: new_user.id) sync_roles(roles_params, platform) if all_target_params.present? all_target_params.each do |project| @@ -35,7 +35,7 @@ class SyncForgeJob < ApplicationJob watchers_params: project["watchers_params"], praise_trends_params: project["praise_trends_params"] } - sync_projects(new_user, user_params["user_id"],target_params, platform) + sync_projects(new_user, user_params["id"],target_params, platform) end end rescue Exception => e @@ -60,7 +60,7 @@ class SyncForgeJob < ApplicationJob begin Rails.logger.info("#######______sync_user_start__########") keys_other_delete = %w(id created_at updated_at user_id) - keys_to_delete = %w(user_id created_on updated_on platform) + keys_to_delete = %w(id created_on updated_on platform) owner_params = owner_params["user"] if old_version_source.include?(platform) #trustie上需要 owner_params = owner_params&.except!(*keys_to_delete)