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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86e444b42125b6ca0ea4ee646da76b3aa49a2d3b3f4ff0f73ea1a4a251b90763
4
- data.tar.gz: 0d7b9e6c6b0d1f9d51222726fdeedfa05d94bb9cb45594dbf407cdaccd984ec8
3
+ metadata.gz: 7676ed353c8221dd290fe5661bae000a5b33ffc1523a666f8d23f9bf13fdef54
4
+ data.tar.gz: a820f49f41ae2be5862212ee1b5c187300218a77058f1877d9b95e53b6a9c811
5
5
  SHA512:
6
- metadata.gz: d60996c7490c1e05da9b878919fbe30457bdbbde8abd914c92375eedf223b09f3d0330a0ac37243633f1bcf74ca36805cea5842cb1ed9ee3883cb54f3b9efd81
7
- data.tar.gz: 5e0029d82a7d93563a32dbf7a513092f800dcf1d1de875c5b3ccfed317543ea76d7707ee932512d2b9367f262089abb24ae86a8ad65368c0601a3363099c6c87
6
+ metadata.gz: 49d1761671bc79f78fab0dfed9f198db1318dc8d7a3fe100937ddd07350259febbac5460022251920366114bb2d39863fefb2cef1867f8fb065a56d2ac258a35
7
+ data.tar.gz: b12f722f29f70cab33189c4201fcbfd02efcd74bee0113e53d0bb10e11cdcf1eff572ae918c8b360f549c85e5a58c349d9170b2cc02faec7f8afba83887cce14
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/Gemfile CHANGED
@@ -9,4 +9,5 @@ group :test do
9
9
  gem "appraisal"
10
10
  gem "guard"
11
11
  gem "guard-rspec"
12
+ gem "rspec"
12
13
  end
@@ -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
- attributes.each_pair do |k, v|
19
- model_instance.send(:"#{k}=", v) if model_instance.respond_to?(:"#{k}=")
20
- end
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
 
@@ -1,5 +1,5 @@
1
1
  module Graphiti
2
2
  module ActiveGraph
3
- VERSION = '0.1.5'
3
+ VERSION = '0.1.6'
4
4
  end
5
5
  end
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.5
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: 2020-10-09 00:00:00.000000000 Z
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
- rubyforge_project:
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