graphiti-activegraph 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/Gemfile +1 -0
- data/graphiti-activegraph.gemspec +1 -0
- data/lib/graphiti/active_graph/adapters/active_graph.rb +7 -4
- data/lib/graphiti/active_graph/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7676ed353c8221dd290fe5661bae000a5b33ffc1523a666f8d23f9bf13fdef54
|
4
|
+
data.tar.gz: a820f49f41ae2be5862212ee1b5c187300218a77058f1877d9b95e53b6a9c811
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49d1761671bc79f78fab0dfed9f198db1318dc8d7a3fe100937ddd07350259febbac5460022251920366114bb2d39863fefb2cef1867f8fb065a56d2ac258a35
|
7
|
+
data.tar.gz: b12f722f29f70cab33189c4201fcbfd02efcd74bee0113e53d0bb10e11cdcf1eff572ae918c8b360f549c85e5a58c349d9170b2cc02faec7f8afba83887cce14
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/Gemfile
CHANGED
@@ -30,4 +30,5 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_development_dependency "activemodel", ">= 4.1"
|
31
31
|
spec.add_development_dependency "graphiti_spec_helpers", "1.0.beta.4"
|
32
32
|
spec.add_development_dependency "standard"
|
33
|
+
spec.add_development_dependency "rspec", "~> 3.9.0"
|
33
34
|
end
|
@@ -15,9 +15,12 @@ module Graphiti::ActiveGraph
|
|
15
15
|
def assign_attributes(model_instance, attributes)
|
16
16
|
model_instance.before_assign_resource_attr if model_instance.respond_to?(:before_assign_resource_attr)
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
# currently there is no possible way to assign association on activegraph without triggering save
|
19
|
+
# https://github.com/neo4jrb/activegraph/issues/1445
|
20
|
+
# using "=" operator bypasses validations and callbacks in case of associations
|
21
|
+
# once above issue is fixed, we can change the below code to assign instead of update
|
22
|
+
|
23
|
+
model_instance.update(attributes)
|
21
24
|
end
|
22
25
|
|
23
26
|
def paginate(scope, current_page, per_page)
|
@@ -43,7 +46,7 @@ module Graphiti::ActiveGraph
|
|
43
46
|
end
|
44
47
|
|
45
48
|
def save(model_instance)
|
46
|
-
model_instance.save
|
49
|
+
model_instance.save if model_instance.changed?
|
47
50
|
model_instance
|
48
51
|
end
|
49
52
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphiti-activegraph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hardik Joshi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphiti
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: rspec
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 3.9.0
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: 3.9.0
|
167
181
|
description:
|
168
182
|
email:
|
169
183
|
- hardikjoshi1991@gmail.com
|
@@ -172,6 +186,7 @@ extensions: []
|
|
172
186
|
extra_rdoc_files: []
|
173
187
|
files:
|
174
188
|
- ".gitignore"
|
189
|
+
- ".rspec"
|
175
190
|
- Gemfile
|
176
191
|
- graphiti-activegraph.gemspec
|
177
192
|
- lib/graphiti-activegraph.rb
|
@@ -211,8 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
226
|
- !ruby/object:Gem::Version
|
212
227
|
version: '0'
|
213
228
|
requirements: []
|
214
|
-
|
215
|
-
rubygems_version: 2.7.6
|
229
|
+
rubygems_version: 3.0.3
|
216
230
|
signing_key:
|
217
231
|
specification_version: 4
|
218
232
|
summary: Easily build jsonapi.org-compatible APIs for GraphDB
|