graphiti-activegraph 0.1.22 → 0.1.23

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: 19fc48bd574a47fdfb5d601d9781a70eab34e3acf7cb62a45143d9a99119feb2
4
- data.tar.gz: 797493838affaa7c58e0ee8c03f50b17f37e8e443c4226b0948bdde4f03f020b
3
+ metadata.gz: d88ca37172c5b507a37ae3744f0a2ac86485b47f5494f0e080f6dbe7e7137738
4
+ data.tar.gz: b78b22b43bc9913ded8262a5d5d16fa2a6d6d5dbc0d8f4b0cfa094231289f858
5
5
  SHA512:
6
- metadata.gz: b9825c5451ec0acdc0e5f94ee5fce3a13b4809b713e7ef2daaec506bedb73fe8b7a5ec70e70126e1cc54cb71cea28726a1c4b5f3bcae440118a3c76c8d49a4a5
7
- data.tar.gz: b33db9527095d1c8c14d1706b37af78839bce57b3d90f4c27e01b161b0ee8161493a188d3b7294859aec85d948db310390105b22cdc93b44128e6021de4a87bc
6
+ metadata.gz: 663ff44a72d8f833f5156e3dd0d3a960c3c77220a0b9191b20afc15104013d267f92c9ff1ed22927f405199c3bc074fa92bbed4d5f57063150a778f7efe5dcc9
7
+ data.tar.gz: 9f19e81f5b2c7fd70585a3ef493a83c06080df69593ae23bd56fd723950ef87a2ecd4c05a6c475c87e1efc627a256aad4597a0c8b77fc731ad7a04b380030892
@@ -18,14 +18,20 @@ jobs:
18
18
  strategy:
19
19
  fail-fast: false
20
20
  matrix:
21
- ruby-version: [ jruby-9.4.3.0, ruby ]
22
-
21
+ ruby-version: [ jruby ]
22
+ env:
23
+ JRUBY_OPTS: --debug -J-Xmx1280m -Xcompile.invokedynamic=false -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-noverify -Xcompile.mode=OFF
23
24
  steps:
24
- - uses: actions/checkout@v3
25
- - name: Set up Ruby
26
- uses: ruby/setup-ruby@v1
27
- with:
28
- ruby-version: ${{ matrix.ruby-version }}
29
- bundler-cache: true
30
- - name: Run tests
31
- run: bundle exec rspec
25
+ - uses: actions/checkout@v3
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: ${{ matrix.ruby-version }}
30
+ bundler-cache: true
31
+ - name: Set up Java
32
+ uses: actions/setup-java@v3
33
+ with:
34
+ distribution: 'temurin'
35
+ java-version: 17
36
+ - name: Run tests
37
+ run: bundle exec rspec
data/CHANGELOG.md CHANGED
@@ -44,6 +44,12 @@ Fixes:
44
44
 
45
45
  - when rendering preloaded resources, we were not applying scoping. Now we are skipping around_scoping callback too.
46
46
 
47
+ ## 0.1.22 (29-04-2024)
48
+
49
+ Features:
50
+
51
+ - Added support for UUID
52
+
47
53
  <!-- ### [version (DD-MM-YYYY)] -->
48
54
  <!-- Breaking changes:-->
49
55
  <!-- Features:-->
data/Gemfile CHANGED
@@ -1,13 +1,3 @@
1
1
  source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
-
5
- gem "zeitwerk"
6
-
7
- group :test do
8
- gem "pry"
9
- gem "appraisal"
10
- gem "guard"
11
- gem "guard-rspec"
12
- gem "rspec"
13
- end
@@ -18,7 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.require_paths = ["lib"]
19
19
 
20
20
  spec.add_dependency "graphiti", ">= 1.2.0"
21
- spec.add_dependency "activegraph", ">= 11.1.0.alpha.1"
21
+ spec.add_dependency "activegraph", "~> 12.0.0.beta.4"
22
+ spec.add_dependency "activesupport", ">= 6.0"
22
23
  spec.add_dependency "zeitwerk"
23
24
 
24
25
  spec.add_development_dependency "faraday", "~> 0.15"
@@ -27,5 +28,6 @@ Gem::Specification.new do |spec|
27
28
  spec.add_development_dependency "rake", "~> 10.0"
28
29
  spec.add_development_dependency "graphiti_spec_helpers", "1.0.beta.4"
29
30
  spec.add_development_dependency "standard"
31
+ spec.add_development_dependency "pry"
30
32
  spec.add_development_dependency "rspec", "~> 3.9.0"
31
33
  end
@@ -1,14 +1,6 @@
1
1
  class Graphiti::ActiveGraph::Adapters::ActiveGraph::HasManySideload < Graphiti::Sideload::HasMany
2
2
  include Graphiti::ActiveGraph::Adapters::ActiveGraph::Sideload
3
3
 
4
- def default_base_scope
5
- resource_class.model.all
6
- end
7
-
8
- def infer_foreign_key
9
- association_name.to_sym
10
- end
11
-
12
4
  def default_value_when_empty
13
5
  []
14
6
  end
@@ -1,14 +1,6 @@
1
1
  class Graphiti::ActiveGraph::Adapters::ActiveGraph::HasOneSideload < Graphiti::Sideload::HasOne
2
2
  include Graphiti::ActiveGraph::Adapters::ActiveGraph::Sideload
3
3
 
4
- def default_base_scope
5
- resource_class.model.all
6
- end
7
-
8
- def infer_foreign_key
9
- association_name.to_sym
10
- end
11
-
12
4
  def default_value_when_empty
13
5
  nil
14
6
  end
@@ -1,15 +1,11 @@
1
1
  class Graphiti::ActiveGraph::Adapters::ActiveGraph::PolymorphicBelongsTo < Graphiti::Sideload::PolymorphicBelongsTo
2
2
  include Graphiti::ActiveGraph::Adapters::ActiveGraph::Sideload
3
3
 
4
- def default_base_scope
5
- resource_class.model.all
6
- end
7
-
8
- def infer_foreign_key
9
- association_name.to_sym
10
- end
11
-
12
4
  def default_value_when_empty
13
5
  nil
14
6
  end
7
+
8
+ def polymorphic?
9
+ true
10
+ end
15
11
  end
@@ -12,57 +12,15 @@ module Graphiti::ActiveGraph::Adapters::ActiveGraph::Sideload
12
12
  end
13
13
  end
14
14
 
15
- # def base_scope
16
- # if @base_scope
17
- # @base_scope.respond_to?(:call) ? @base_scope.call : @base_scope
18
- # else
19
- # resource.base_scope
20
- # end
21
- # end
22
-
23
- # def load(parents, query, graph_parent)
24
- # params, opts, proxy = nil, nil, nil
25
-
26
- # with_error_handling Errors::SideloadParamsError do
27
- # params = load_params(parents, query)
28
- # params_proc&.call(params, parents, context)
29
- # return [] if blank_query?(params)
30
- # opts = load_options(parents, query)
31
- # opts[:sideload] = self
32
- # opts[:parent] = graph_parent
33
- # end
34
-
35
- # with_error_handling(Errors::SideloadQueryBuildingError) do
36
- # proxy = resource.class._all(params, opts, base_scope)
37
- # pre_load_proc&.call(proxy, parents)
38
- # end
39
-
40
- # proxy.to_a
41
- # end
42
-
43
- # def load(parents, _, _)
44
- # child_arr = []
45
- # @child_map = resource_with_parent_assoc(parents).each_with_object({}) do |arr, hash|
46
- # child_obj = arr.first
47
- # parent_uuid = arr.last
48
- # hash[parent_uuid] ||= []
49
- # hash[parent_uuid] << child_obj
50
- # child_arr << child_obj
51
- # end
52
-
53
- # fire_assign(parents, child_arr)
54
- # child_arr
55
- # end
15
+ def default_base_scope
16
+ resource_class.model.all
17
+ end
56
18
 
57
- # def resource_with_parent_assoc(parents)
58
- # parent_ids = parents.pluck(:id)
59
- # proxy = parent_resource_class.model.as(:p).where(id: parent_ids)
60
- # scope = self.class.sideload_scope
19
+ def infer_foreign_key
20
+ association_name.to_sym
21
+ end
61
22
 
62
- # if scope.present?
63
- # scope.call(proxy)
64
- # else
65
- # proxy.send(association_name, :children)
66
- # end.query.pluck(:children, p: :neo_id)
67
- # end
23
+ def polymorphic?
24
+ false
25
+ end
68
26
  end
@@ -64,11 +64,11 @@ module Graphiti::ActiveGraph
64
64
 
65
65
  def add_path_id_to_relationships!(params)
66
66
  return params if path_relationships_updated?
67
- detect_conflict(:id, @params[:id], attributes[:id])
67
+ detect_conflict(:id, @params[:id]&.to_s, attributes[:id]&.to_s)
68
68
  path_map.each do |rel_name, path_value|
69
69
  body_value = relationships.dig(rel_name, :attributes, :id)
70
70
  if body_value
71
- detect_conflict(rel_name, path_value.to_i, body_value&.to_i)
71
+ detect_conflict(rel_name, path_value&.to_s, body_value&.to_s)
72
72
  else
73
73
  update_params(params, rel_name, path_value)
74
74
  update_realationships(rel_name, path_value)
@@ -92,13 +92,13 @@ module Graphiti::ActiveGraph
92
92
  params[:data][:relationships][rel_name] = {
93
93
  data: {
94
94
  type: derive_resource_type(rel_name),
95
- id: path_value.to_i
95
+ id: path_value
96
96
  }
97
97
  }
98
98
  end
99
99
 
100
100
  def update_realationships(rel_name, path_value)
101
- relationships[rel_name] = { meta: {}, attributes: { id: path_value.to_i } }
101
+ relationships[rel_name] = { meta: {}, attributes: { id: path_value } }
102
102
  end
103
103
 
104
104
  def path_map
@@ -1,5 +1,5 @@
1
1
  module Graphiti
2
2
  module ActiveGraph
3
- VERSION = '0.1.22'
3
+ VERSION = '0.1.23'
4
4
  end
5
5
  end
@@ -1,4 +1,4 @@
1
- require 'zeitwerk'
1
+ require 'active_support'
2
2
  require 'active_graph'
3
3
 
4
4
  # Workaround for jruby prepend issue https://github.com/jruby/jruby/issues/6971
@@ -13,6 +13,7 @@ require 'graphiti/resource/persistence'
13
13
  require 'graphiti/resource/interface'
14
14
  # End workaround for jruby prepend issue
15
15
 
16
+ require 'zeitwerk'
16
17
  loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
17
18
  loader.inflector.inflect 'version' => 'VERSION'
18
19
  loader.ignore(File.expand_path('graphiti-activegraph.rb', __dir__))
metadata CHANGED
@@ -1,22 +1,22 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiti-activegraph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22
4
+ version: 0.1.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hardik Joshi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-07 00:00:00.000000000 Z
11
+ date: 2024-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: graphiti
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
18
  version: 1.2.0
19
+ name: graphiti
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
@@ -25,26 +25,40 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.2.0
27
27
  - !ruby/object:Gem::Dependency
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: 12.0.0.beta.4
28
33
  name: activegraph
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 12.0.0.beta.4
41
+ - !ruby/object:Gem::Dependency
29
42
  requirement: !ruby/object:Gem::Requirement
30
43
  requirements:
31
44
  - - ">="
32
45
  - !ruby/object:Gem::Version
33
- version: 11.1.0.alpha.1
46
+ version: '6.0'
47
+ name: activesupport
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - ">="
39
53
  - !ruby/object:Gem::Version
40
- version: 11.1.0.alpha.1
54
+ version: '6.0'
41
55
  - !ruby/object:Gem::Dependency
42
- name: zeitwerk
43
56
  requirement: !ruby/object:Gem::Requirement
44
57
  requirements:
45
58
  - - ">="
46
59
  - !ruby/object:Gem::Version
47
60
  version: '0'
61
+ name: zeitwerk
48
62
  type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
@@ -53,12 +67,12 @@ dependencies:
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
- name: faraday
57
70
  requirement: !ruby/object:Gem::Requirement
58
71
  requirements:
59
72
  - - "~>"
60
73
  - !ruby/object:Gem::Version
61
74
  version: '0.15'
75
+ name: faraday
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
@@ -67,12 +81,12 @@ dependencies:
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0.15'
69
83
  - !ruby/object:Gem::Dependency
70
- name: kaminari
71
84
  requirement: !ruby/object:Gem::Requirement
72
85
  requirements:
73
86
  - - "~>"
74
87
  - !ruby/object:Gem::Version
75
88
  version: '0.17'
89
+ name: kaminari
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
@@ -81,12 +95,12 @@ dependencies:
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0.17'
83
97
  - !ruby/object:Gem::Dependency
84
- name: bundler
85
98
  requirement: !ruby/object:Gem::Requirement
86
99
  requirements:
87
100
  - - ">="
88
101
  - !ruby/object:Gem::Version
89
102
  version: '0'
103
+ name: bundler
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
@@ -95,12 +109,12 @@ dependencies:
95
109
  - !ruby/object:Gem::Version
96
110
  version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
- name: rake
99
112
  requirement: !ruby/object:Gem::Requirement
100
113
  requirements:
101
114
  - - "~>"
102
115
  - !ruby/object:Gem::Version
103
116
  version: '10.0'
117
+ name: rake
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -109,12 +123,12 @@ dependencies:
109
123
  - !ruby/object:Gem::Version
110
124
  version: '10.0'
111
125
  - !ruby/object:Gem::Dependency
112
- name: graphiti_spec_helpers
113
126
  requirement: !ruby/object:Gem::Requirement
114
127
  requirements:
115
128
  - - '='
116
129
  - !ruby/object:Gem::Version
117
130
  version: 1.0.beta.4
131
+ name: graphiti_spec_helpers
118
132
  type: :development
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
@@ -123,12 +137,26 @@ dependencies:
123
137
  - !ruby/object:Gem::Version
124
138
  version: 1.0.beta.4
125
139
  - !ruby/object:Gem::Dependency
140
+ requirement: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
126
145
  name: standard
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
127
154
  requirement: !ruby/object:Gem::Requirement
128
155
  requirements:
129
156
  - - ">="
130
157
  - !ruby/object:Gem::Version
131
158
  version: '0'
159
+ name: pry
132
160
  type: :development
133
161
  prerelease: false
134
162
  version_requirements: !ruby/object:Gem::Requirement
@@ -137,12 +165,12 @@ dependencies:
137
165
  - !ruby/object:Gem::Version
138
166
  version: '0'
139
167
  - !ruby/object:Gem::Dependency
140
- name: rspec
141
168
  requirement: !ruby/object:Gem::Requirement
142
169
  requirements:
143
170
  - - "~>"
144
171
  - !ruby/object:Gem::Version
145
172
  version: 3.9.0
173
+ name: rspec
146
174
  type: :development
147
175
  prerelease: false
148
176
  version_requirements: !ruby/object:Gem::Requirement
@@ -205,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
233
  - !ruby/object:Gem::Version
206
234
  version: '0'
207
235
  requirements: []
208
- rubygems_version: 3.3.7
236
+ rubygems_version: 3.3.26
209
237
  signing_key:
210
238
  specification_version: 4
211
239
  summary: Easily build jsonapi.org-compatible APIs for GraphDB