graphql-activerecord 0.6.6 → 0.6.7

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: 1d8154b1d374aef93dd407f8f5851add24c49a36
4
- data.tar.gz: f4a4ca605d49b7941ad320ff8ff58467991b577b
3
+ metadata.gz: ea206475115f125b4737f85251ee149550462dc0
4
+ data.tar.gz: e5c43b72e56875f407ec79d54e08678f765deadd
5
5
  SHA512:
6
- metadata.gz: f14015e23391a7545045d97f9c0b5f13827b5e4625e878d64e1514814c4a41c351f60b81aec9b14bcf03735be8c9401f74bd5ecb2cd25cf9614e24c7868fd27f
7
- data.tar.gz: 5250315201f6acb4bf38dabe57482d9fd864f133d16b695f70f40f4f992ff82ebc2110a0bf0a6eafa10f8baa7aa8d502d318e9f6bbd7c018969b07b45d3bb965
6
+ metadata.gz: 710667348e3cbc1287f5b65b1d999d3f4b303e675bd851360dd5169e87be220e105b0ee6aa4bd0aaf1602d70712f76c64a87e21e00a68b9fc46248c5a1b88563
7
+ data.tar.gz: dc098d499193ad53caa7fcd80d2042b5daf64ffa62a4b8dee3a04e9b9f4bd89ef7ec0f874dc93953b0e2b243db39f32a2cf1f578515023948b0e253fe9a068bd
@@ -78,6 +78,17 @@ module GraphQL::Models
78
78
  changes.push({ model_instance: child_model, action: :destroy })
79
79
  elsif child_model.nil? && !next_inputs.nil?
80
80
  child_model = model.public_send("build_#{child_map.association}")
81
+
82
+ assoc = model.association(child_map.association)
83
+ refl = assoc.reflection
84
+
85
+ if refl.options.include?(:as)
86
+ inverse_name = refl.options[:as]
87
+ inverse_assoc = child_model.association(inverse_name)
88
+ inverse_assoc.target = model
89
+ inverse_assoc.inversed = true
90
+ end
91
+
81
92
  changes.push({ model_instance: child_model, action: :create })
82
93
  end
83
94
 
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Models
3
- VERSION = "0.6.6"
3
+ VERSION = "0.6.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Foster
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-07 00:00:00.000000000 Z
11
+ date: 2016-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  requirements: []
92
92
  rubyforge_project:
93
- rubygems_version: 2.5.1
93
+ rubygems_version: 2.4.8
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: ActiveRecord helpers for GraphQL + Relay