graphiti 1.0.alpha.20 → 1.0.alpha.21

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: 3e748663dcd4e93cbaaf9304a1d5690863f0ff5d
4
- data.tar.gz: 056c6acfc9aa1c68509a8e650b8dc0da393262d3
3
+ metadata.gz: 620890dfa261a4dd02ddb09ee9211989ae0287f1
4
+ data.tar.gz: 572c653a33fd31bd60804036b5ef0d271eb6244b
5
5
  SHA512:
6
- metadata.gz: 4a80207f722f242e74182f7b2029739cd13db051554ccf09dfc97815f1c8c1d17a89f0b7f2e945f75e4be4461c4cc1c4bbde3afbe392d4059087110b1def1678
7
- data.tar.gz: 5001801f9b0f0ed74f127f6efce115e307b79dc18a08fa9a662a3a1b7b8b3602b8d7b6bb2d620f9b14f7ec271ee70dd19160fe7ce775f4836289a0ae3ce9b775
6
+ metadata.gz: aabddf2beaf88b0520a75e1dd9ef388eb7956bde1e4c2d9bd8c5e91a9c252dbe0e3b29ea48692a70042df1605c35888247598085e5191e0ba6c6d111f3eb4498
7
+ data.tar.gz: 3ed785cf44d9b978c91367ee4c0714deb0faa744b540db799679f3ec25f338b2e6a1b7489e61121d28f61b5c1f92793e5e29c214d379183b55e8adada5e48de5
@@ -30,6 +30,10 @@ module Graphiti
30
30
  " routes.default_url_options[:host] = ENV.fetch('HOST', 'http://localhost:3000')\n"
31
31
  end
32
32
 
33
+ inject_into_file 'spec/rails_helper.rb', after: /RSpec.configure.+^end$/m do
34
+ "\n\nGraphitiSpecHelpers::RSpec.schema!"
35
+ end
36
+
33
37
  insert_into_file "config/routes.rb", :after => "Rails.application.routes.draw do\n" do
34
38
  <<-STR
35
39
  scope path: ApplicationResource.endpoint_namespace, defaults: { format: :jsonapi } do
@@ -22,7 +22,6 @@ RSpec.describe "<%= type %>#create", type: :request do
22
22
  expect {
23
23
  make_request
24
24
  }.to change { <%= model_class %>.count }.by(1)
25
- <%= var %> = <%= model_class %>.last
26
25
  expect(response.status).to eq(201)
27
26
  end
28
27
  end
@@ -41,12 +41,17 @@ module Graphiti
41
41
  def sideload(results)
42
42
  return if results == []
43
43
 
44
- concurrent = ::Graphiti.config.concurrency
44
+ concurrent = true#::Graphiti.config.concurrency
45
45
  promises = []
46
46
 
47
47
  @query.sideloads.each_pair do |name, q|
48
48
  sideload = @resource.class.sideload(name)
49
- resolve_sideload = -> { sideload.resolve(results, q) }
49
+ resolve_sideload = -> {
50
+ sideload.resolve(results, q)
51
+ if concurrent && defined?(ActiveRecord)
52
+ ActiveRecord::Base.clear_active_connections!
53
+ end
54
+ }
50
55
  if concurrent
51
56
  promises << Concurrent::Promise.execute(&resolve_sideload)
52
57
  else
@@ -1,3 +1,3 @@
1
1
  module Graphiti
2
- VERSION = "1.0.alpha.20"
2
+ VERSION = "1.0.alpha.21"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiti
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.alpha.20
4
+ version: 1.0.alpha.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-03 00:00:00.000000000 Z
11
+ date: 2018-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jsonapi-serializable