dina 0.5.7.0 → 0.5.9.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/casters/multilingual_title.rb +1 -1
- data/lib/dina/models/object_store/file.rb +16 -3
- data/lib/dina/search/base_search.rb +11 -2
- 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: f95a0329ac306f75e3076a3f193da193d0722ff3677415f6301925509ed77d46
|
4
|
+
data.tar.gz: 00ff890a78d22da1e6d48a664293802fe67ec1e3cd9e943c7b8816a6a422e964
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1709d2a17af2ef4ecf9c99718c708d64759ee4449d8a524159fea8a4ca7c24be3fca262a33da7eeae938766f215378000c194354cbb8f5859fbf18106c29e66
|
7
|
+
data.tar.gz: 65610e9edab365148c8f390cb91c45cfb004135dc7e620734e710ba893afe12427e6efaa34c28c270cfd658935f5465ac535b0d0d4aa90c595300eb403ca552c
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Dina
|
2
2
|
class File < BaseModel
|
3
|
-
attr_accessor :file_path, :group, :is_derivative
|
3
|
+
attr_accessor :id, :file_path, :group, :is_derivative
|
4
4
|
|
5
5
|
def self.verify_ssl
|
6
6
|
begin
|
@@ -21,7 +21,17 @@ module Dina
|
|
21
21
|
)
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
24
|
+
def self.create(attributes = {})
|
25
|
+
new(attributes).tap do |resource|
|
26
|
+
resource.save
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def initialize(attributes = {})
|
31
|
+
@id = attributes[:id] || SecureRandom.uuid
|
32
|
+
@group = attributes[:group] || nil
|
33
|
+
@is_derivative = attributes[:is_derivative] || false
|
34
|
+
@file_path = attributes[:file_path] || nil
|
25
35
|
end
|
26
36
|
|
27
37
|
def endpoint
|
@@ -33,7 +43,7 @@ module Dina
|
|
33
43
|
end
|
34
44
|
|
35
45
|
def table_name
|
36
|
-
"file/#{
|
46
|
+
"file/#{group.downcase}"
|
37
47
|
end
|
38
48
|
|
39
49
|
def url
|
@@ -64,6 +74,9 @@ module Dina
|
|
64
74
|
private
|
65
75
|
|
66
76
|
def validate_params
|
77
|
+
if id.nil? || !id.is_uuid?
|
78
|
+
raise ObjectInvalid, "#{self.class} is invalid. id is not a UUID."
|
79
|
+
end
|
67
80
|
if group.nil?
|
68
81
|
raise ObjectInvalid, "#{self.class} is invalid. group is required."
|
69
82
|
end
|
@@ -1,5 +1,13 @@
|
|
1
1
|
module Dina
|
2
|
-
class BaseSearch
|
2
|
+
class BaseSearch < BaseModel
|
3
|
+
|
4
|
+
def self.verify_ssl
|
5
|
+
begin
|
6
|
+
connection_options[:ssl][:verify]
|
7
|
+
rescue
|
8
|
+
true
|
9
|
+
end
|
10
|
+
end
|
3
11
|
|
4
12
|
def self.endpoint
|
5
13
|
Dina::Authentication.endpoint_url
|
@@ -36,7 +44,8 @@ module Dina
|
|
36
44
|
accept: 'application/json',
|
37
45
|
content_type: 'application/json',
|
38
46
|
authorization: Dina::Authentication.header
|
39
|
-
}
|
47
|
+
},
|
48
|
+
verify_ssl: verify_ssl
|
40
49
|
)
|
41
50
|
JSON.parse(response, symbolize_names: true)
|
42
51
|
rescue RestClient::ExceptionWithResponse => e
|
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.5.
|
4
|
+
version: 0.5.9.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: 2022-12-
|
11
|
+
date: 2022-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json_api_client
|