dina 0.8.1.0 → 0.8.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dina/models/base_model.rb +6 -1
- data/lib/dina/models/material_sample/collecting_event.rb +1 -4
- data/lib/dina/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 194f73d318f76f43a6e65426a47fb0ad5192de5c007660633bdd9f8fb9f86ecd
|
4
|
+
data.tar.gz: 2aba2864327b88821e62865d469844bbbff6b9e9f5b440c77b0698e67605c82f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a906a03f0288fba3f9194ad1274eacd9abedf1abd0bd4fc1f1c39b46268f52cff94fbd2f2ca1a0d936f677088d3b9f3e78466a725ad2e1976035334fcc605a8
|
7
|
+
data.tar.gz: 4d869369dd2ec0a2a3607d1a1159b94b54ea802fc8336bfc9689ead30f705bf54ab54ce1a5b2c476985ca9f363c5791383769e251a03afacfb817839744f8ee0
|
@@ -3,6 +3,7 @@ module Dina
|
|
3
3
|
include JsonApiClient::Helpers::Callbacks
|
4
4
|
|
5
5
|
self.raise_on_blank_find_param = true
|
6
|
+
self.add_defaults_to_changes = true
|
6
7
|
self.json_key_format = :camelized_key
|
7
8
|
self.paginator = JsonApiClient::Paginating::NestedParamPaginator
|
8
9
|
|
@@ -54,11 +55,15 @@ module Dina
|
|
54
55
|
end
|
55
56
|
|
56
57
|
def on_before_create
|
57
|
-
self.attributes.delete_if { |k, v| v.nil? || v == "" }
|
58
|
+
self.attributes.delete_if { |k, v| v.nil? || v == "" || ((v.is_a?(Array) || v.is_a?(Hash)) && v.empty?) }
|
58
59
|
self.attributes = self.attributes.deep_symbolize_keys
|
59
60
|
end
|
60
61
|
|
61
62
|
def on_before_save
|
63
|
+
unknown_attributes = self.attributes.symbolize_keys.keys - self.class.properties.keys - [:type]
|
64
|
+
if unknown_attributes.size > 0
|
65
|
+
raise ObjectInvalid, "#{self.class} is invalid. #{unknown_attributes.join(", ")} are not accepted properties."
|
66
|
+
end
|
62
67
|
if !self.valid?
|
63
68
|
raise ObjectInvalid, "#{self.class} is invalid. #{self.errors.map(&:message).join("; ")}"
|
64
69
|
end
|
@@ -36,7 +36,7 @@ module Dina
|
|
36
36
|
property :tags, type: :array, default: []
|
37
37
|
property :geographicPlaceNameSource, type: :string
|
38
38
|
property :geographicPlaceNameSourceDetail, type: :object, default: {}
|
39
|
-
property :managedAttributes, type: :
|
39
|
+
property :managedAttributes, type: :object
|
40
40
|
property :geoReferenceAssertions, type: :array, default: []
|
41
41
|
property :eventGeom, type: :string
|
42
42
|
property :extensionValues, type: :array, default: []
|
@@ -68,9 +68,6 @@ module Dina
|
|
68
68
|
if self.geographicPlaceNameSource.nil?
|
69
69
|
self.geographicPlaceNameSourceDetail = nil
|
70
70
|
end
|
71
|
-
if !self.geoReferenceAssertions.empty? && self.geoReferenceAssertions[0][:dwcDecimalLatitude].nil?
|
72
|
-
self.geoReferenceAssertions = nil
|
73
|
-
end
|
74
71
|
super
|
75
72
|
end
|
76
73
|
|
data/lib/dina/version.rb
CHANGED
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.8.
|
4
|
+
version: 0.8.3.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-01-
|
11
|
+
date: 2023-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json_api_client
|