From baf659643a701c7c495d1b3d85981a08f342d7d6 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Tue, 22 Dec 2020 21:18:40 +0100 Subject: [PATCH] handle missing rights text. #691 --- app/models/doi.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/doi.rb b/app/models/doi.rb index b5b650ad8..3c1d77b7e 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -1779,7 +1779,7 @@ def check_dates def check_rights_list Array.wrap(rights_list).each do |r| errors.add(:rights_list, "Rights '#{r}' should be an object instead of a string.") unless r.is_a?(Hash) - errors.add(:rights_list, "Rights should not have a length of more than 2000 characters.") if r["rights"].length > 2000 + errors.add(:rights_list, "Rights should not have a length of more than 2000 characters.") if r["rights"].to_s.length > 2000 end end