From 6ecb0a204e3d99c97a275f4a3307bc87613fa3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Wed, 29 Dec 2021 15:18:54 +0800 Subject: [PATCH] fix error --- lib/tasks/sync_asia_personal_data_tasks.rake | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/tasks/sync_asia_personal_data_tasks.rake b/lib/tasks/sync_asia_personal_data_tasks.rake index cc4aa80..20a16f3 100644 --- a/lib/tasks/sync_asia_personal_data_tasks.rake +++ b/lib/tasks/sync_asia_personal_data_tasks.rake @@ -50,7 +50,7 @@ module AsiaSyncPlugin puts "Journal Paper for user: #{user.user_name}" journal_papers = query_result["journal"].to_a if !query_result['emp'].blank? - JournalPaper.where(member_profile_id: user.member_profile_id,:rss2_id=>nil).destroy + JournalPaper.where(member_profile_id: user.member_profile_id,:rss2_id.ne=>nil).destroy end return if journal_papers.count == 0 journal_papers.each do |journal_paper| @@ -76,7 +76,7 @@ module AsiaSyncPlugin puts "Conference Paper for user: #{user.user_name}" conference_papers = query_result["conference"].to_a if !query_result['emp'].blank? - WritingConference.where(member_profile_id: user.member_profile_id,:rss2_id=>nil).destroy + WritingConference.where(member_profile_id: user.member_profile_id,:rss2_id.ne=>nil).destroy end return if conference_papers.count == 0 conference_papers.each do |conference_paper| @@ -99,7 +99,7 @@ module AsiaSyncPlugin puts "Projects(Research Grants) for user: #{user.user_name}" projects = query_result["research"].to_a if !query_result['emp'].blank? - Project.where(member_profile_id: user.member_profile_id,:rss2_id=>nil).destroy + Project.where(member_profile_id: user.member_profile_id,:rss2_id.ne=>nil).destroy end return if projects.count == 0 projects.each do |project| @@ -125,7 +125,7 @@ module AsiaSyncPlugin books = query_result["books"].to_a books1 = query_result["books1"].to_a if !query_result['emp'].blank? - Book.where(member_profile_id: user.member_profile_id,:rss2_id=>nil).destroy + Book.where(member_profile_id: user.member_profile_id,:rss2_id.ne=>nil).destroy end return if (books.count == 0 && books1.count == 0) books.each do |book| @@ -168,7 +168,7 @@ module AsiaSyncPlugin puts "Patents for user: #{user.user_name}" patents = query_result["patent"].to_a if !query_result['emp'].blank? - Patent.where(member_profile_id: user.member_profile_id,:rss2_id=>nil).destroy + Patent.where(member_profile_id: user.member_profile_id,:rss2_id.ne=>nil).destroy end return if (patents.count == 0 ) patents.each do |patent| @@ -194,7 +194,7 @@ module AsiaSyncPlugin puts "Honors(Awards) for user: #{user.user_name}" honors = query_result["award"].to_a if !query_result['emp'].blank? - Honor.where(member_profile_id: user.member_profile_id,:rss2_id=>nil).destroy + Honor.where(member_profile_id: user.member_profile_id,:rss2_id.ne=>nil).destroy end return if (honors.count == 0 ) honors.each do |honor| @@ -213,7 +213,7 @@ module AsiaSyncPlugin puts "Activities(Shows) for user: #{user.user_name}" activities = query_result["show"].to_a if !query_result['emp'].blank? - Activity.where(member_profile_id: user.member_profile_id,:rss2_id=>nil).destroy + Activity.where(member_profile_id: user.member_profile_id,:rss2_id.ne=>nil).destroy end return if (activities.count == 0 ) activities.each do |activity| @@ -236,7 +236,7 @@ module AsiaSyncPlugin puts "Courses(Course Information) for user: #{user.user_name}" courses = query_result["cos_data"].to_a if !query_result['emp'].blank? - Course.where(member_profile_id: user.member_profile_id,:rss2_id=>nil).destroy + Course.where(member_profile_id: user.member_profile_id,:rss2_id.ne=>nil).destroy end return if (courses.count == 0 ) courses.each do |course| @@ -277,7 +277,7 @@ module AsiaSyncPlugin puts "Researches(Thesis Advisor) for user: #{user.user_name}" researches = query_result["paper_data"].to_a if !query_result['emp'].blank? - Research.where(member_profile_id: user.member_profile_id,:rss2_id=>nil).destroy + Research.where(member_profile_id: user.member_profile_id,:rss2_id.ne=>nil).destroy end return if (researches.count == 0 ) researches.each do |research| @@ -299,7 +299,7 @@ module AsiaSyncPlugin puts "Create Designs for user: #{user.user_name}" create_designs = query_result["create"].to_a if !query_result['emp'].blank? - CreateDesign.where(member_profile_id: user.member_profile_id,:rss2_id=>nil).destroy + CreateDesign.where(member_profile_id: user.member_profile_id,:rss2_id.ne=>nil).destroy end return if (create_designs.count == 0 ) create_designs.each do |create_design| @@ -318,7 +318,7 @@ module AsiaSyncPlugin puts "Technology Transfers for user: #{user.user_name}" tec_transfers = query_result["tec_transfer"].to_a if !query_result['emp'].blank? - TecTransfer.where(member_profile_id: user.member_profile_id,:rss2_id=>nil).destroy + TecTransfer.where(member_profile_id: user.member_profile_id,:rss2_id.ne=>nil).destroy end return if (tec_transfers.count == 0 ) tec_transfers.each do |tec_transfer| @@ -342,7 +342,7 @@ module AsiaSyncPlugin puts "College Projects for user: #{user.user_name}" college_projects = query_result["college_data"].to_a if !query_result['emp'].blank? - CollegeProject.where(member_profile_id: user.member_profile_id,:rss2_id=>nil).destroy + CollegeProject.where(member_profile_id: user.member_profile_id,:rss2_id.ne=>nil).destroy end return if (college_projects.count == 0 ) college_projects.each do |college_project|