Skip to content

Commit 04d5fe4

Browse files
committed
Protection to non-valid original publications
1 parent c263363 commit 04d5fe4

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

app/models/name.rb

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,19 +1073,26 @@ def notified?
10731073
!!register.try(:notified?)
10741074
end
10751075

1076+
# Find the earliest publication date of either the effective publication
1077+
# or any non-valid "original" publication
1078+
def earliest_publication_date
1079+
date = proposed_in.try(:journal_date).try(:to_datetime)
1080+
not_validly_proposed_in.each do |nv_pub|
1081+
nv_time = nv_pub.journal_date.try(:to_datetime) or next
1082+
date ||= nv_time
1083+
date = nv_time if nv_time < date
1084+
end
1085+
date
1086+
end
1087+
10761088
def priority_date
10771089
@priority_date ||= self[:priority_date]
10781090
if !@priority_date && seqcode?
10791091
if above_rank?(:family)
10801092
@priority_date = type_name.try(:priority_date)
10811093
elsif genus_affected_by_23d_amendment?
10821094
# Whitman amendment to Rule 23d
1083-
@priority_date = proposed_in.try(:journal_date).try(:to_datetime)
1084-
not_validly_proposed_in.each do |nv_pub|
1085-
nv_time = nv_pub.journal_date.try(:to_datetime) or next
1086-
@priority_date ||= nv_time
1087-
@priority_date = nv_time if nv_time < @priority_date
1088-
end
1095+
@priority_date = earliest_publication_date
10891096
else
10901097
@priority_date = register.try(:priority_date)
10911098
end
@@ -1101,16 +1108,16 @@ def priority_date
11011108
def genus_would_be_affected_by_23d_amendment?
11021109
(seqcode? || !validated?) &&
11031110
inferred_rank == 'genus' &&
1104-
proposed_in&.journal_date&.year.present? &&
1105-
proposed_in.journal_date.year < 2022
1111+
earliest_publication_date.try(:year).present? &&
1112+
earliest_publication_date.year < 2022
11061113
end
11071114

11081115
##
11091116
# Is this a genus falling under the protection of Rule 23d?
11101117
def genus_affected_by_23d_amendment?
11111118
seqcode? &&
11121119
genus_would_be_affected_by_23d_amendment? &&
1113-
register&.priority_date&.year.present? &&
1120+
register.try(:priority_date).try(:year).present? &&
11141121
register.priority_date.year < 2027
11151122
end
11161123

0 commit comments

Comments
 (0)