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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14a5ebae258900b3ecacd4333e27c10b8155fe3d
4
- data.tar.gz: 73c7362207e3f7ce2bec8a212e9b48dcbe40d1d1
3
+ metadata.gz: 25b698d864605b30560a52da370edfb2aee42519
4
+ data.tar.gz: 65bb6a5854806d2e432b6d837c6cb4f1ff4fb73e
5
5
  SHA512:
6
- metadata.gz: 95ba2765a7f3173831984f2743fe375771dcc7fe75ef5a4aa0a76de85d0f38700aadb7b5420e1c7269dbb6d15856a30f000347afe8da571388dbfa75892a06e3
7
- data.tar.gz: f924f57463b6c6e348c02528c53636b2ec00e7de189b2e8077081d6e7fd8a6a747626398ce722701cc41a4b3cabdfce3f99f78d4afc3e9f28719ad17c2ab3a06
6
+ metadata.gz: bbdaa4da26ee09bc60d25e7282e2d49308dd61eea88b7e6c24304845cceb9054c42db497ea16700353bed2833ccdb6f6e83ee708dce0713b435e1e8eb2a285d8
7
+ data.tar.gz: 5c79458107d236444075c651fb32d0b465f370362a4a0be30a089bb9f893c0338441f39a56f171831cb548b20ae303ccf9d3fcdefda7bc39dda49413c7530118
@@ -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
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Ddr
2
2
  module Models
3
- VERSION = "3.0.4"
3
+ VERSION = "3.0.5"
4
4
  end
5
5
  end
@@ -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
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-22 00:00:00.000000000 Z
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
@@ -1,13 +0,0 @@
1
- module Ddr::Models
2
- module AutoVersion
3
-
4
- def self.extended(base)
5
- base.include Versionable
6
-
7
- base.class_eval do
8
- after_save :create_version
9
- end
10
- end
11
-
12
- end
13
- end
@@ -1,12 +0,0 @@
1
- module Ddr::Models
2
- module Versionable
3
-
4
- # Override AF::Versionable
5
- # @example
6
- # => "version.20160205153424.643252000"
7
- def version_name
8
- "version.#{Time.now.utc.strftime('%Y%m%d%H%M%S.%N')}"
9
- end
10
-
11
- end
12
- end