From aa67a3aa3e2591e3cee804a926f455028f233479 Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Fri, 10 Feb 2023 18:23:13 +0100
Subject: [PATCH] fix

---
 app/controllers/admin/research/researchers_controller.rb | 2 +-
 app/models/research/publication.rb                       | 2 +-
 app/models/university/person/with_research.rb            | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/controllers/admin/research/researchers_controller.rb b/app/controllers/admin/research/researchers_controller.rb
index de9b4683d..a96265b0c 100644
--- a/app/controllers/admin/research/researchers_controller.rb
+++ b/app/controllers/admin/research/researchers_controller.rb
@@ -29,7 +29,7 @@ class Admin::Research::ResearchersController < Admin::Research::ApplicationContr
     ].each do |key|
       @researcher.update_column key, params[key] if params.has_key?(key)
     end
-    @researcher.load_research_publications_without_delay!
+    @researcher.import_research_publications_from_hal_without_delay!
     redirect_to admin_research_researcher_path(@researcher)
   end
 
diff --git a/app/models/research/publication.rb b/app/models/research/publication.rb
index 25a95309b..5100f60a9 100644
--- a/app/models/research/publication.rb
+++ b/app/models/research/publication.rb
@@ -49,7 +49,7 @@ class Research::Publication < ApplicationRecord
   def self.update_from_hal
     University::Person::Researcher.with_hal_identifier.find_each do |researcher|
       puts "Loading publications for #{researcher} (#{researcher.university})"
-      researcher.load_research_publications!
+      researcher.import_research_publications_from_hal!
     end
   end
 
diff --git a/app/models/university/person/with_research.rb b/app/models/university/person/with_research.rb
index ab8f52038..8292f37dc 100644
--- a/app/models/university/person/with_research.rb
+++ b/app/models/university/person/with_research.rb
@@ -15,7 +15,7 @@ module University::Person::WithResearch
     hal_form_identifier.present?
   end
 
-  def load_research_publications!
+  def import_research_publications_from_hal!
     return unless hal_identity?
     response = HalOpenscience::Document.search  "authIdForm_i:#{hal_form_identifier}",
                                                 fields: ["docid", "title_s", "citationRef_s", "uri_s", "*"],
@@ -25,7 +25,7 @@ module University::Person::WithResearch
       research_publications << publication unless publication.in?(research_publications)
     end
   end
-  handle_asynchronously :load_research_publications!
+  handle_asynchronously :import_research_publications_from_hal!
 
   def possible_hal_authors
     HalOpenscience::Author.search(to_s, fields: ['*']).results
-- 
GitLab