Skip to content

Commit 35e95d6

Browse files
committed
Validate orcid in has_orcid
1 parent 6f6fbb6 commit 35e95d6

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

app/models/concerns/has_orcid.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module HasOrcid
44
included do
55
auto_strip_attributes :orcid
66
before_validation :normalize_orcid
7+
validates :orcid, orcid: true, allow_blank: true
78
end
89

910
def orcid_url

app/models/profile.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Profile < ApplicationRecord
88

99
validates :firstname, :surname, :description, presence: true, if: :public?
1010
validates :website, url: true, http_url: { allow_inaccessible: true }, allow_blank: true
11-
validates :orcid, orcid: true, allow_blank: true
11+
1212
after_validation :check_public
1313
after_commit :reindex_trainer, on: %i[create update]
1414
clean_array_fields(:expertise_academic, :expertise_technical, :fields,

0 commit comments

Comments
 (0)