From 165220cac8bb0052721c248e16bed16884b442d2 Mon Sep 17 00:00:00 2001 From: Mike Bennett Date: Mon, 16 May 2022 09:26:33 +0100 Subject: [PATCH 1/2] Correct reference type placement --- app/models/event.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/event.rb b/app/models/event.rb index 10e50dd80..38f9c53c8 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -86,10 +86,10 @@ class Event < ApplicationRecord ].freeze # renamed to make it clearer that these relation types are grouped together as references - REFERENCE_RELATION_TYPES = %w[is-cited-by is-supplement-to references].freeze + REFERENCE_RELATION_TYPES = %w[cites is-supplement-to references].freeze # renamed to make it clearer that these relation types are grouped together as citations - CITATION_RELATION_TYPES = %w[cites is-supplemented-by is-referenced-by].freeze + CITATION_RELATION_TYPES = %w[is-cited-by is-supplemented-by is-referenced-by].freeze RELATIONS_RELATION_TYPES = %w[ compiles From 766596f0177c7ad163b0c3bf230662f1dbf6f380 Mon Sep 17 00:00:00 2001 From: Mike Bennett Date: Mon, 16 May 2022 09:27:05 +0100 Subject: [PATCH 2/2] Remove fix testing code --- app/models/event.rb | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/app/models/event.rb b/app/models/event.rb index 38f9c53c8..02c80b803 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -1029,23 +1029,6 @@ def set_source_and_target_doi self.source_relation_type_id = "parts" self.target_relation_type_id = "part_of" end - - ## If the two DOI's involved are Cody and Mike's intro blog posts - ## _AND_ is a cites/is-cited-by, then switch for testing - if (subj_id == "https://doi.org/10.5438/sjx9-hb16" && obj_id == "https://doi.org/10.5438/cq8g-b226") || (obj_id == "https://doi.org/10.5438/sjx9-hb16" && subj_id == "https://doi.org/10.5438/cq8g-b226") - if relation_type_id == "is-cited-by" - self.source_doi = uppercase_doi_from_url(obj_id) - self.target_doi = uppercase_doi_from_url(subj_id) - self.source_relation_type_id = "references" - self.target_relation_type_id = "citations" - elsif relation_type_id == "cites" - self.source_doi = uppercase_doi_from_url(subj_id) - self.target_doi = uppercase_doi_from_url(obj_id) - self.source_relation_type_id = "references" - self.target_relation_type_id = "citations" - end - end - ## END TEST ## end def set_defaults