dina 0.9.3.0 → 0.9.4.0

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
  SHA256:
3
- metadata.gz: bfef7d758b28bc4f34d911162514d1b60e6910006fc3dc5b3bb2f7161f656bd3
4
- data.tar.gz: 4b674557b19e9062142863d152b8c0e23adcc84026b8d6da90f7c6a00e57df4a
3
+ metadata.gz: 4ade9c659dcb46ebc4adf629603c8aead276a6d1e729d693bd9446cb413d94c1
4
+ data.tar.gz: 38ae031053085d502ad177ca4e93db7b332333440d539000d5e3c94a3f18fbdd
5
5
  SHA512:
6
- metadata.gz: ec0c717478fc104083152e45bb55a7dec18a48c7daa3f1c58d9a2d891526a89d506277a6a18772b5c992bb8ed0e5ce095aba14cdc640712b20c5e3f8d0616d1c
7
- data.tar.gz: 8735acc8abb2b2c8494de65602fdfd4ce3a4363b08adec86e66fdc9f730020467fbd73a21bdf73a8693da011da185beef80d89e399cfdfc3016b9ab8a250faa5
6
+ metadata.gz: fa3002e9f71c97a244cb31b087e24e1cfe233bbc3fd8142deabe24678b7d6498d062f8c76d7154e1bd1cb2d628f20bc0fff22df344137dd8d5dfe7a641f8e8b8
7
+ data.tar.gz: 4b19c84e78efdbcdc1d90e7bdd65fe8a9ec83159f9d9e3c2f37fd2a8bd778be3c02ce189a71b9a6d3808ae6f144e6014e7c8ccfa1d4b455382120f658302235d
@@ -12,7 +12,7 @@ module Dina
12
12
  property :acHashValue, type: :string
13
13
  property :derivativeType, type: :string
14
14
 
15
- belongs_to :ac_derived_from, shallow_path: true, class_name: "ObjectStore"
15
+ has_one :ac_derived_from, class_name: "ObjectStore"
16
16
 
17
17
  validates_presence_of :bucket, message: "bucket is required"
18
18
  validates_presence_of :dcFormat, message: "dcFormat is required"
@@ -31,6 +31,9 @@ module Dina
31
31
  private
32
32
 
33
33
  def on_before_save
34
+ if self.as_json_api["relationships"].nil? || !self.as_json_api["relationships"].has_key?("acDerivedFrom")
35
+ raise ObjectInvalid, "#{self.class} is invalid. ac_derived_from relationship is required"
36
+ end
34
37
  super
35
38
  end
36
39
 
data/lib/dina/version.rb CHANGED
@@ -3,7 +3,7 @@ module Dina
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 9
6
- PATCH = 3
6
+ PATCH = 4
7
7
  BUILD = 0
8
8
 
9
9
  def self.version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dina
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3.0
4
+ version: 0.9.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David P. Shorthouse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-01 00:00:00.000000000 Z
11
+ date: 2023-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json_api_client