sufia-models 6.0.0.rc1 → 6.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concerns/sufia/user.rb +1 -1
- data/app/models/sufia/orcid_validator.rb +5 -1
- data/lib/sufia/models/version.rb +1 -1
- data/sufia-models.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61b522c3064c907375bcbad951e0878c3b692fac
|
4
|
+
data.tar.gz: a4074b935257278771c9e4808d8c8dd5c87ebc48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73aacb00e97352fbaad299467c98ca52349d11b8070da097aa565403ebf46398e3550d97066b3242b56180d14b9604ef1ab76c6b5b1714cee03c3cec8789ad4b
|
7
|
+
data.tar.gz: 3ae78655ec6badec1106aeebe2833729591744c877bd1571ed87da3314dfa4fc49fff1f0637dd303f34661778996ea6b33dc129475d3aa0156dd4ce12aefaf54
|
@@ -44,7 +44,7 @@ module Sufia::User
|
|
44
44
|
# 2. the orcid field is blank
|
45
45
|
# 3. the orcid is already in its normalized form
|
46
46
|
return if self.errors[:orcid].first.present? || self.orcid.blank? || self.orcid.starts_with?('http://orcid.org/')
|
47
|
-
bare_orcid =
|
47
|
+
bare_orcid = Sufia::OrcidValidator.match(self.orcid).string
|
48
48
|
self.orcid = "http://orcid.org/#{bare_orcid}"
|
49
49
|
end
|
50
50
|
|
@@ -2,7 +2,11 @@ module Sufia
|
|
2
2
|
class OrcidValidator < ActiveModel::Validator
|
3
3
|
def validate(record)
|
4
4
|
return if record.orcid.blank?
|
5
|
-
record.errors.add(:orcid, 'must be a string of 19 characters, e.g., "0000-0000-0000-0000"') unless
|
5
|
+
record.errors.add(:orcid, 'must be a string of 19 characters, e.g., "0000-0000-0000-0000"') unless self.class.match(record.orcid)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.match(string)
|
9
|
+
/\d{4}-\d{4}-\d{4}-\d{3}[\dX]/.match(string)
|
6
10
|
end
|
7
11
|
end
|
8
12
|
end
|
data/lib/sufia/models/version.rb
CHANGED
data/sufia-models.gemspec
CHANGED
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_dependency 'rails', '~> 4.0', '< 5.0.0'
|
30
30
|
spec.add_dependency 'activeresource', "~> 4.0" # No longer a dependency of rails 4.0
|
31
31
|
|
32
|
-
spec.add_dependency "hydra-head", "~> 9.0.0.
|
33
|
-
spec.add_dependency "active-fedora", "~> 9.0.0.
|
32
|
+
spec.add_dependency "hydra-head", "~> 9.0.0.rc3"
|
33
|
+
spec.add_dependency "active-fedora", "~> 9.0.0.rc3"
|
34
34
|
spec.add_dependency "hydra-collections", "~> 4.0.0.rc2"
|
35
35
|
spec.add_dependency 'hydra-derivatives', '~> 1.0.0.rc1'
|
36
36
|
spec.add_dependency 'nest', '~> 1.1'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sufia-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.0.
|
4
|
+
version: 6.0.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Friesen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -78,28 +78,28 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: 9.0.0.
|
81
|
+
version: 9.0.0.rc3
|
82
82
|
type: :runtime
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: 9.0.0.
|
88
|
+
version: 9.0.0.rc3
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: active-fedora
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 9.0.0.
|
95
|
+
version: 9.0.0.rc3
|
96
96
|
type: :runtime
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 9.0.0.
|
102
|
+
version: 9.0.0.rc3
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: hydra-collections
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|