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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d6e9fe995f047640837186d5468d2c13c1a4bde5
4
- data.tar.gz: 2802d8cdee2d9bc7a029be53053a8d2df0e56358
3
+ metadata.gz: f09e37f6279e040ac0253e63ff2f10bc822ea67b
4
+ data.tar.gz: eae2cdca8cae11738a8ef38f4ce591659de08932
5
5
  SHA512:
6
- metadata.gz: bb9d0289ef5b574b75447c06531416f306db195ad9a3e213cba51ab4671bd3cf62504a107f5647f6a6f2262b45805d832ad88bfbbf5252d3b953d2a2963dd743
7
- data.tar.gz: 9d38118312e0e27e71c8035b40eabc23c15719bbe33b87d4deb2e99fc1347f95384e457ee1480ebbab71d6072eff3750281dc96b8a8fc933ca6639365da27c13
6
+ metadata.gz: 1845a18da24c50ac546f0c6f92836ebcc68143f83a37559386a831541945ec5932ba515e1c0976950a93c0e94854ed3e18f8136df9b668eb88469550d536a290
7
+ data.tar.gz: 5021dbc8d25fbcdf3221490b9fcfbc1fa64dcabdb76703d8707708a2636c34cb96d299e6e6678d0e2fde6ddb523eb25a9da148dd89991e9e4c9a26f04133a070
data/.circleci/config.yml CHANGED
@@ -3,7 +3,7 @@ version: 2
3
3
  jobs:
4
4
  build:
5
5
  docker:
6
- - image: circleci/ruby:2.3.7-node-browsers
6
+ - image: circleci/ruby:2.4.6-node-browsers
7
7
  environment:
8
8
  RAILS_ENV: test
9
9
  DB_HOST: localhost
data/.rubocop.yml CHANGED
@@ -14,6 +14,7 @@ Naming/FileName:
14
14
  Metrics/BlockLength:
15
15
  Exclude:
16
16
  - 'spec/**/*.rb'
17
+ - 'valkyrie-sequel.gemspec'
17
18
  Metrics/ClassLength:
18
19
  Exclude:
19
20
  - 'lib/valkyrie/sequel/query_service.rb'
@@ -199,7 +199,7 @@ module Valkyrie::Sequel
199
199
  end
200
200
 
201
201
  def ordered_property?(resource:, property:)
202
- resource.class.schema[property].meta.try(:[], :ordered)
202
+ resource.ordered_attribute?(property)
203
203
  end
204
204
  end
205
205
  end
@@ -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::Postgres::ORMConverter::RDFMetadata.new(object[:metadata]).result
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
- primary_terms.include?(k)
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.to_h
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
- !primary_terms.include?(k) && !blacklist_terms.include?(k)
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
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Valkyrie
3
3
  module Sequel
4
- VERSION = "1.1.0"
4
+ VERSION = "2.0.0.RC1"
5
5
  end
6
6
  end
@@ -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", '>= 1.5.0', '< 3.0.0'
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: 1.1.0
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-04-18 00:00:00.000000000 Z
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: 1.5.0
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: 1.5.0
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: '0'
233
+ version: 1.3.1
234
234
  requirements: []
235
235
  rubyforge_project:
236
236
  rubygems_version: 2.6.14