ddr-models 3.0.4 → 3.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ddr/models.rb +0 -2
- data/lib/ddr/models/base.rb +7 -1
- data/lib/ddr/models/version.rb +1 -1
- data/spec/support/shared_examples_for_ddr_models.rb +10 -0
- metadata +2 -4
- data/lib/ddr/models/auto_version.rb +0 -13
- data/lib/ddr/models/versionable.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25b698d864605b30560a52da370edfb2aee42519
|
4
|
+
data.tar.gz: 65bb6a5854806d2e432b6d837c6cb4f1ff4fb73e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbdaa4da26ee09bc60d25e7282e2d49308dd61eea88b7e6c24304845cceb9054c42db497ea16700353bed2833ccdb6f6e83ee708dce0713b435e1e8eb2a285d8
|
7
|
+
data.tar.gz: 5c79458107d236444075c651fb32d0b465f370362a4a0be30a089bb9f893c0338441f39a56f171831cb548b20ae303ccf9d3fcdefda7bc39dda49413c7530118
|
data/lib/ddr/models.rb
CHANGED
@@ -27,7 +27,6 @@ module Ddr
|
|
27
27
|
autoload :AdminSet
|
28
28
|
autoload :AttachedFileProfile
|
29
29
|
autoload :AttachedFilesProfile
|
30
|
-
autoload :AutoVersion
|
31
30
|
autoload :Base
|
32
31
|
autoload :ChecksumInvalid, 'ddr/models/error'
|
33
32
|
autoload :Contact
|
@@ -57,7 +56,6 @@ module Ddr
|
|
57
56
|
autoload :UrlSafeId
|
58
57
|
autoload :Validatable
|
59
58
|
autoload :Validator
|
60
|
-
autoload :Versionable
|
61
59
|
autoload :WithContentFile
|
62
60
|
autoload :YearFacet
|
63
61
|
|
data/lib/ddr/models/base.rb
CHANGED
@@ -9,7 +9,6 @@ module Ddr::Models
|
|
9
9
|
include Indexing
|
10
10
|
include Hydra::Validations
|
11
11
|
include HasAdminMetadata
|
12
|
-
# extend AutoVersion
|
13
12
|
extend Relation
|
14
13
|
|
15
14
|
SAVE_NOTIFICATION = "save.base.models.ddr"
|
@@ -184,5 +183,12 @@ module Ddr::Models
|
|
184
183
|
raise NotImplementedError, "Must be implemented by subclasses"
|
185
184
|
end
|
186
185
|
|
186
|
+
# Override AF::Versionable
|
187
|
+
# @example
|
188
|
+
# => "version.20160205153424.643252000"
|
189
|
+
def version_name
|
190
|
+
"version.#{Time.now.utc.strftime('%Y%m%d%H%M%S.%N')}"
|
191
|
+
end
|
192
|
+
|
187
193
|
end
|
188
194
|
end
|
data/lib/ddr/models/version.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require "time"
|
2
|
+
|
1
3
|
RSpec.shared_examples "a DDR model" do
|
2
4
|
describe "#desc_metadata_terms" do
|
3
5
|
it "should have a default value" do
|
@@ -237,4 +239,12 @@ RSpec.shared_examples "a DDR model" do
|
|
237
239
|
expect(events).to eq([subject.id])
|
238
240
|
}
|
239
241
|
end
|
242
|
+
|
243
|
+
describe "#version_name" do
|
244
|
+
let(:now) { DateTime.parse("2016-06-29T18:01:15Z").to_time }
|
245
|
+
before {
|
246
|
+
allow(Time).to receive(:now) { now }
|
247
|
+
}
|
248
|
+
its(:version_name) { is_expected.to eq("version.20160629180115.000000000") }
|
249
|
+
end
|
240
250
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ddr-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Coble
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-06-
|
12
|
+
date: 2016-06-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -532,7 +532,6 @@ files:
|
|
532
532
|
- lib/ddr/models/admin_set.rb
|
533
533
|
- lib/ddr/models/attached_file_profile.rb
|
534
534
|
- lib/ddr/models/attached_files_profile.rb
|
535
|
-
- lib/ddr/models/auto_version.rb
|
536
535
|
- lib/ddr/models/base.rb
|
537
536
|
- lib/ddr/models/contact.rb
|
538
537
|
- lib/ddr/models/engine.rb
|
@@ -576,7 +575,6 @@ files:
|
|
576
575
|
- lib/ddr/models/validatable.rb
|
577
576
|
- lib/ddr/models/validator.rb
|
578
577
|
- lib/ddr/models/version.rb
|
579
|
-
- lib/ddr/models/versionable.rb
|
580
578
|
- lib/ddr/models/with_content_file.rb
|
581
579
|
- lib/ddr/models/year_facet.rb
|
582
580
|
- lib/ddr/notifications.rb
|