valkyrie-sequel 1.1.0 → 2.0.0.RC1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -1
- data/.rubocop.yml +1 -0
- data/lib/valkyrie/sequel/query_service.rb +1 -1
- data/lib/valkyrie/sequel/resource_factory/orm_converter.rb +1 -1
- data/lib/valkyrie/sequel/resource_factory/resource_converter.rb +14 -18
- data/lib/valkyrie/sequel/version.rb +1 -1
- data/valkyrie-sequel.gemspec +1 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f09e37f6279e040ac0253e63ff2f10bc822ea67b
|
4
|
+
data.tar.gz: eae2cdca8cae11738a8ef38f4ce591659de08932
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1845a18da24c50ac546f0c6f92836ebcc68143f83a37559386a831541945ec5932ba515e1c0976950a93c0e94854ed3e18f8136df9b668eb88469550d536a290
|
7
|
+
data.tar.gz: 5021dbc8d25fbcdf3221490b9fcfbc1fa64dcabdb76703d8707708a2636c34cb96d299e6e6678d0e2fde6ddb523eb25a9da148dd89991e9e4c9a26f04133a070
|
data/.circleci/config.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -54,7 +54,7 @@ module Valkyrie::Sequel
|
|
54
54
|
# Generate a Hash derived from Valkyrie Resource metadata encoded in the RDF
|
55
55
|
# @return [Hash]
|
56
56
|
def rdf_metadata
|
57
|
-
@rdf_metadata ||= Valkyrie::Persistence::
|
57
|
+
@rdf_metadata ||= Valkyrie::Persistence::Shared::JSONValueMapper.new(object[:metadata]).result
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -1,6 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Valkyrie::Sequel
|
3
3
|
class ResourceFactory::ResourceConverter
|
4
|
+
PRIMARY_TERMS = [
|
5
|
+
:id,
|
6
|
+
:created_at,
|
7
|
+
:updated_at,
|
8
|
+
:internal_resource
|
9
|
+
].freeze
|
10
|
+
|
11
|
+
BLACKLIST_TERMS = [
|
12
|
+
:new_record
|
13
|
+
].freeze
|
14
|
+
|
4
15
|
attr_reader :resource, :resource_factory
|
5
16
|
delegate :orm_class, :adapter, to: :resource_factory
|
6
17
|
delegate :resources, to: :adapter
|
@@ -34,14 +45,14 @@ module Valkyrie::Sequel
|
|
34
45
|
|
35
46
|
def database_hash
|
36
47
|
resource_hash.select do |k, _v|
|
37
|
-
|
48
|
+
PRIMARY_TERMS.include?(k)
|
38
49
|
end.compact.merge(
|
39
50
|
metadata: ::Sequel.pg_json(metadata_hash)
|
40
51
|
)
|
41
52
|
end
|
42
53
|
|
43
54
|
def resource_hash
|
44
|
-
@resource_hash ||= resource.
|
55
|
+
@resource_hash ||= resource.__attributes__
|
45
56
|
end
|
46
57
|
|
47
58
|
# Convert attributes to all be arrays to better enable querying and
|
@@ -57,23 +68,8 @@ module Valkyrie::Sequel
|
|
57
68
|
|
58
69
|
def selected_resource_attributes
|
59
70
|
resource_hash.select do |k, _v|
|
60
|
-
!
|
71
|
+
!PRIMARY_TERMS.include?(k) && !BLACKLIST_TERMS.include?(k)
|
61
72
|
end
|
62
73
|
end
|
63
|
-
|
64
|
-
def primary_terms
|
65
|
-
[
|
66
|
-
:id,
|
67
|
-
:created_at,
|
68
|
-
:updated_at,
|
69
|
-
:internal_resource
|
70
|
-
]
|
71
|
-
end
|
72
|
-
|
73
|
-
def blacklist_terms
|
74
|
-
[
|
75
|
-
:new_record
|
76
|
-
]
|
77
|
-
end
|
78
74
|
end
|
79
75
|
end
|
data/valkyrie-sequel.gemspec
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
# frozen_string_literal: true
|
3
2
|
lib = File.expand_path("../lib", __FILE__)
|
4
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
@@ -23,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
23
22
|
|
24
23
|
spec.add_dependency "sequel"
|
25
24
|
spec.add_dependency "sequel_pg"
|
26
|
-
spec.add_dependency "valkyrie", '>=
|
25
|
+
spec.add_dependency "valkyrie", '>= 2.0.0.RC6', '< 3.0.0'
|
27
26
|
spec.add_dependency "oj"
|
28
27
|
spec.add_development_dependency "bundler", "~> 1.16"
|
29
28
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: valkyrie-sequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.RC1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trey Pendragon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 2.0.0.RC6
|
48
48
|
- - "<"
|
49
49
|
- !ruby/object:Gem::Version
|
50
50
|
version: 3.0.0
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
requirements:
|
55
55
|
- - ">="
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version:
|
57
|
+
version: 2.0.0.RC6
|
58
58
|
- - "<"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: 3.0.0
|
@@ -228,9 +228,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
228
228
|
version: '0'
|
229
229
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
230
230
|
requirements:
|
231
|
-
- - "
|
231
|
+
- - ">"
|
232
232
|
- !ruby/object:Gem::Version
|
233
|
-
version:
|
233
|
+
version: 1.3.1
|
234
234
|
requirements: []
|
235
235
|
rubyforge_project:
|
236
236
|
rubygems_version: 2.6.14
|