graphiti 1.3.4 → 1.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +96 -0
- data/.standard.yml +4 -4
- data/Appraisals +18 -44
- data/gemfiles/rails_5_2.gemfile +2 -2
- data/gemfiles/rails_5_2_graphiti_rails.gemfile +3 -4
- data/gemfiles/rails_6_graphiti_rails.gemfile +1 -2
- data/gemfiles/{rails_5_1.gemfile → rails_7.gemfile} +2 -2
- data/gemfiles/{rails_4.gemfile → rails_7_graphiti_rails.gemfile} +3 -2
- data/graphiti.gemspec +5 -5
- data/lib/graphiti/adapters/abstract.rb +1 -1
- data/lib/graphiti/adapters/active_record.rb +34 -34
- data/lib/graphiti/adapters/persistence/associations.rb +13 -15
- data/lib/graphiti/delegates/pagination.rb +2 -4
- data/lib/graphiti/extensions/temp_id.rb +1 -1
- data/lib/graphiti/filter_operators.rb +0 -1
- data/lib/graphiti/hash_renderer.rb +5 -1
- data/lib/graphiti/query.rb +59 -69
- data/lib/graphiti/railtie.rb +4 -4
- data/lib/graphiti/request_validator.rb +1 -1
- data/lib/graphiti/resource/dsl.rb +5 -4
- data/lib/graphiti/resource/polymorphism.rb +1 -1
- data/lib/graphiti/resource/sideloading.rb +2 -2
- data/lib/graphiti/resource_proxy.rb +1 -1
- data/lib/graphiti/schema.rb +5 -3
- data/lib/graphiti/scoping/sort.rb +4 -6
- data/lib/graphiti/sideload/polymorphic_belongs_to.rb +3 -4
- data/lib/graphiti/stats/dsl.rb +0 -1
- data/lib/graphiti/util/simple_errors.rb +3 -3
- data/lib/graphiti/version.rb +1 -1
- data/lib/graphiti.rb +1 -0
- metadata +17 -23
- data/.travis.yml +0 -94
- data/gemfiles/rails_5_0.gemfile +0 -18
- data/gemfiles/rails_5_0_graphiti_rails.gemfile +0 -20
- data/gemfiles/rails_5_1_graphiti_rails.gemfile +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbf1dc5382739c7385f30c8edc31742239c10ccd62c2ab424ffede31f2dae7ea
|
4
|
+
data.tar.gz: 5cba74c229d05543c276103b0500da935011ddf8ae34defd952e83d5870eb894
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0bf531d0a71e736105e857e32e0fb97465113fcf174e3c69a26965e21d081c52dc81b0dd8cf887be3311f49a18a4ae4cbb5ef4515927fab32c9d346d59a35a1
|
7
|
+
data.tar.gz: b71a81ffc7fa94667173d41fb388364b452d96f50a23ba410238a913463c10cc92d992c2a0586ee2ba6243aeed6cf63470c4cc0536043f05ffd42715e2c90947
|
@@ -0,0 +1,96 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request: {}
|
7
|
+
|
8
|
+
concurrency:
|
9
|
+
group: ci-${{ github.head_ref || github.ref }}
|
10
|
+
cancel-in-progress: true
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
lint:
|
14
|
+
name: Lint
|
15
|
+
runs-on: ubuntu-latest
|
16
|
+
steps:
|
17
|
+
- uses: actions/checkout@v2
|
18
|
+
- uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: "3.0"
|
21
|
+
bundler-cache: true
|
22
|
+
- name: Run standardrb
|
23
|
+
run: bundle exec standardrb --no-fix --format progress
|
24
|
+
test:
|
25
|
+
name: "Tests - ${{ matrix.ruby }} | ${{ matrix.gemfile }} | Appraisal: ${{ matrix.appraisal }}"
|
26
|
+
runs-on: ubuntu-latest
|
27
|
+
strategy:
|
28
|
+
fail-fast: false
|
29
|
+
matrix:
|
30
|
+
ruby:
|
31
|
+
- "2.6"
|
32
|
+
- "2.7"
|
33
|
+
- "3.0"
|
34
|
+
- "3.1"
|
35
|
+
gemfile:
|
36
|
+
- Gemfile
|
37
|
+
- gemfiles/rails_5_2.gemfile
|
38
|
+
- gemfiles/rails_6.gemfile
|
39
|
+
- gemfiles/rails_7.gemfile
|
40
|
+
- gemfiles/rails_5_2_graphiti_rails.gemfile
|
41
|
+
- gemfiles/rails_6_graphiti_rails.gemfile
|
42
|
+
- gemfiles/rails_7_graphiti_rails.gemfile
|
43
|
+
appraisal:
|
44
|
+
- true
|
45
|
+
- false
|
46
|
+
include:
|
47
|
+
- ruby: ruby-head
|
48
|
+
gemfile: Gemfile
|
49
|
+
appraisal: true
|
50
|
+
- ruby: ruby-head
|
51
|
+
gemfile: Gemfile
|
52
|
+
appraisal: false
|
53
|
+
exclude:
|
54
|
+
# Skip some extra variants
|
55
|
+
- gemfile: Gemfile
|
56
|
+
appraisal: true
|
57
|
+
- gemfile: gemfiles/rails_5_2.gemfile
|
58
|
+
appraisal: false
|
59
|
+
- gemfile: gemfiles/rails_6.gemfile
|
60
|
+
appraisal: false
|
61
|
+
- gemfile: gemfiles/rails_7.gemfile
|
62
|
+
appraisal: false
|
63
|
+
- gemfile: gemfiles/rails_5_2_graphiti_rails.gemfile
|
64
|
+
appraisal: false
|
65
|
+
- gemfile: gemfiles/rails_6_graphiti_rails.gemfile
|
66
|
+
appraisal: false
|
67
|
+
- gemfile: gemfiles/rails_7_graphiti_rails.gemfile
|
68
|
+
appraisal: false
|
69
|
+
# Rails 5 can't run on Ruby 3
|
70
|
+
- gemfile: gemfiles/rails_5_2.gemfile
|
71
|
+
ruby: 3.0
|
72
|
+
- gemfile: gemfiles/rails_5_2_graphiti_rails.gemfile
|
73
|
+
ruby: 3.0
|
74
|
+
- gemfile: gemfiles/rails_5_2.gemfile
|
75
|
+
ruby: 3.1
|
76
|
+
- gemfile: gemfiles/rails_5_2_graphiti_rails.gemfile
|
77
|
+
ruby: 3.1
|
78
|
+
# Raise 7 can't run on 2.6
|
79
|
+
- gemfile: gemfiles/rails_7.gemfile
|
80
|
+
ruby: 2.6
|
81
|
+
- gemfile: gemfiles/rails_7_graphiti_rails.gemfile
|
82
|
+
ruby: 2.6
|
83
|
+
continue-on-error: ${{ matrix.ruby == 'ruby-head' }}
|
84
|
+
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
|
85
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
|
86
|
+
steps:
|
87
|
+
- name: Set up Appraisal
|
88
|
+
if: matrix.appraisal
|
89
|
+
run: echo "APPRAISAL_INITIALIZED=true" >> $GITHUB_ENV
|
90
|
+
- uses: actions/checkout@v2
|
91
|
+
- uses: ruby/setup-ruby@v1
|
92
|
+
with:
|
93
|
+
ruby-version: ${{ matrix.ruby }}
|
94
|
+
bundler-cache: true
|
95
|
+
- name: Run tests
|
96
|
+
run: bundle exec rspec
|
data/.standard.yml
CHANGED
@@ -8,7 +8,7 @@ ignore:
|
|
8
8
|
# There are some false hits when doing repeated
|
9
9
|
# Class.new blocks in different test cases
|
10
10
|
- Lint/DuplicateMethods
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
-
|
11
|
+
# We define a lot of test-specific classes within our test blocks
|
12
|
+
# There's probably a better way to do this, but it's not worth the
|
13
|
+
# effort right now, so let's just disable for specs
|
14
|
+
- Lint/ConstantDefinitionInBlock
|
data/Appraisals
CHANGED
@@ -1,70 +1,44 @@
|
|
1
|
-
appraise "rails-4" do
|
2
|
-
gem "rails", "~> 4.2"
|
3
|
-
gem "rspec-rails"
|
4
|
-
gem "sqlite3", "~> 1.3.6"
|
5
|
-
gem "database_cleaner"
|
6
|
-
end
|
7
|
-
|
8
|
-
appraise "rails-5_0" do
|
9
|
-
gem "rails", "~> 5.0"
|
10
|
-
gem "rspec-rails"
|
11
|
-
gem "sqlite3", "~> 1.3.6"
|
12
|
-
gem "database_cleaner"
|
13
|
-
end
|
14
|
-
|
15
|
-
appraise "rails-5_1" do
|
16
|
-
gem "rails", "~> 5.1"
|
17
|
-
gem "rspec-rails"
|
18
|
-
gem "sqlite3", "~> 1.3.6"
|
19
|
-
gem "database_cleaner"
|
20
|
-
end
|
21
|
-
|
22
1
|
appraise "rails-5_2" do
|
23
|
-
gem "rails", "~> 5.2"
|
2
|
+
gem "rails", "~> 5.2.0"
|
24
3
|
gem "rspec-rails"
|
25
|
-
gem "sqlite3", "~> 1.
|
4
|
+
gem "sqlite3", "~> 1.4.0"
|
26
5
|
gem "database_cleaner"
|
27
6
|
end
|
28
7
|
|
29
|
-
appraise "rails-
|
30
|
-
gem "rails", "~> 5.0"
|
8
|
+
appraise "rails-5_2-graphiti-rails" do
|
9
|
+
gem "rails", "~> 5.2.0"
|
31
10
|
gem "rspec-rails"
|
32
|
-
gem "sqlite3", "~> 1.
|
11
|
+
gem "sqlite3", "~> 1.4.0"
|
33
12
|
gem "database_cleaner"
|
34
|
-
gem "
|
35
|
-
gem "graphiti-rails", git: "https://github.com/wagenet/graphiti-rails.git", branch: "master"
|
13
|
+
gem "graphiti-rails", "~> 0.4.0"
|
36
14
|
end
|
37
15
|
|
38
|
-
appraise "rails-
|
39
|
-
gem "rails", "~>
|
16
|
+
appraise "rails-6" do
|
17
|
+
gem "rails", "~> 6.0"
|
40
18
|
gem "rspec-rails"
|
41
|
-
gem "sqlite3", "~> 1.
|
19
|
+
gem "sqlite3", "~> 1.4.0"
|
42
20
|
gem "database_cleaner"
|
43
|
-
gem "rescue_registry", git: "https://github.com/wagenet/rescue_registry.git", branch: "master"
|
44
|
-
gem "graphiti-rails", git: "https://github.com/wagenet/graphiti-rails.git", branch: "master"
|
45
21
|
end
|
46
22
|
|
47
|
-
appraise "rails-
|
48
|
-
gem "rails", "~>
|
23
|
+
appraise "rails-6-graphiti-rails" do
|
24
|
+
gem "rails", "~> 6.0"
|
49
25
|
gem "rspec-rails"
|
50
|
-
gem "sqlite3", "~> 1.
|
26
|
+
gem "sqlite3", "~> 1.4.0"
|
51
27
|
gem "database_cleaner"
|
52
|
-
gem "
|
53
|
-
gem "graphiti-rails", git: "https://github.com/wagenet/graphiti-rails.git", branch: "master"
|
28
|
+
gem "graphiti-rails", "~> 0.4.0"
|
54
29
|
end
|
55
30
|
|
56
|
-
appraise "rails-
|
57
|
-
gem "rails", "~>
|
31
|
+
appraise "rails-7" do
|
32
|
+
gem "rails", "~> 7.0"
|
58
33
|
gem "rspec-rails"
|
59
34
|
gem "sqlite3", "~> 1.4.0"
|
60
35
|
gem "database_cleaner"
|
61
36
|
end
|
62
37
|
|
63
|
-
appraise "rails-
|
64
|
-
gem "rails", "~>
|
38
|
+
appraise "rails-7-graphiti-rails" do
|
39
|
+
gem "rails", "~> 7.0"
|
65
40
|
gem "rspec-rails"
|
66
41
|
gem "sqlite3", "~> 1.4.0"
|
67
42
|
gem "database_cleaner"
|
68
|
-
gem "
|
69
|
-
gem "graphiti-rails", git: "https://github.com/wagenet/graphiti-rails.git", branch: "master"
|
43
|
+
gem "graphiti-rails", "~> 0.4.0"
|
70
44
|
end
|
data/gemfiles/rails_5_2.gemfile
CHANGED
@@ -2,12 +2,11 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "rails", "~> 5.2"
|
5
|
+
gem "rails", "~> 5.2.0"
|
6
6
|
gem "rspec-rails"
|
7
|
-
gem "sqlite3", "~> 1.
|
7
|
+
gem "sqlite3", "~> 1.4.0"
|
8
8
|
gem "database_cleaner"
|
9
|
-
gem "
|
10
|
-
gem "graphiti-rails", git: "https://github.com/wagenet/graphiti-rails.git", branch: "master"
|
9
|
+
gem "graphiti-rails", "~> 0.4.0"
|
11
10
|
|
12
11
|
group :test do
|
13
12
|
gem "pry"
|
@@ -6,8 +6,7 @@ gem "rails", "~> 6.0"
|
|
6
6
|
gem "rspec-rails"
|
7
7
|
gem "sqlite3", "~> 1.4.0"
|
8
8
|
gem "database_cleaner"
|
9
|
-
gem "
|
10
|
-
gem "graphiti-rails", git: "https://github.com/wagenet/graphiti-rails.git", branch: "master"
|
9
|
+
gem "graphiti-rails", "~> 0.4.0"
|
11
10
|
|
12
11
|
group :test do
|
13
12
|
gem "pry"
|
data/graphiti.gemspec
CHANGED
@@ -16,20 +16,20 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.bindir = "exe"
|
17
17
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
18
18
|
spec.require_paths = ["lib"]
|
19
|
-
spec.required_ruby_version =
|
19
|
+
spec.required_ruby_version = ">= 2.6"
|
20
20
|
|
21
21
|
spec.add_dependency "jsonapi-serializable", "~> 0.3.0"
|
22
22
|
spec.add_dependency "jsonapi-renderer", "~> 0.2", ">= 0.2.2"
|
23
23
|
spec.add_dependency "dry-types", ">= 0.15.0", "< 2.0"
|
24
24
|
spec.add_dependency "graphiti_errors", "~> 1.1.0"
|
25
25
|
spec.add_dependency "concurrent-ruby", "~> 1.0"
|
26
|
-
spec.add_dependency "activesupport", ">=
|
26
|
+
spec.add_dependency "activesupport", ">= 5.2"
|
27
27
|
|
28
28
|
spec.add_development_dependency "faraday", "~> 0.15"
|
29
29
|
spec.add_development_dependency "kaminari", "~> 0.17"
|
30
30
|
spec.add_development_dependency "bundler"
|
31
|
-
spec.add_development_dependency "rake", "
|
32
|
-
spec.add_development_dependency "standard", "
|
33
|
-
spec.add_development_dependency "activemodel", ">=
|
31
|
+
spec.add_development_dependency "rake", ">= 10.0"
|
32
|
+
spec.add_development_dependency "standard", "~> 1.4.0"
|
33
|
+
spec.add_development_dependency "activemodel", ">= 5.2"
|
34
34
|
spec.add_development_dependency "graphiti_spec_helpers", "1.0.beta.4"
|
35
35
|
end
|
@@ -19,24 +19,24 @@ module Graphiti
|
|
19
19
|
def filter_eq(scope, attribute, value)
|
20
20
|
scope.where(attribute => value)
|
21
21
|
end
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
alias_method :filter_integer_eq, :filter_eq
|
23
|
+
alias_method :filter_float_eq, :filter_eq
|
24
|
+
alias_method :filter_big_decimal_eq, :filter_eq
|
25
|
+
alias_method :filter_date_eq, :filter_eq
|
26
|
+
alias_method :filter_boolean_eq, :filter_eq
|
27
|
+
alias_method :filter_uuid_eq, :filter_eq
|
28
|
+
alias_method :filter_enum_eq, :filter_eq
|
29
29
|
|
30
30
|
def filter_not_eq(scope, attribute, value)
|
31
31
|
scope.where.not(attribute => value)
|
32
32
|
end
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
33
|
+
alias_method :filter_integer_not_eq, :filter_not_eq
|
34
|
+
alias_method :filter_float_not_eq, :filter_not_eq
|
35
|
+
alias_method :filter_big_decimal_not_eq, :filter_not_eq
|
36
|
+
alias_method :filter_date_not_eq, :filter_not_eq
|
37
|
+
alias_method :filter_boolean_not_eq, :filter_not_eq
|
38
|
+
alias_method :filter_uuid_not_eq, :filter_not_eq
|
39
|
+
alias_method :filter_enum_not_eq, :filter_not_eq
|
40
40
|
|
41
41
|
def filter_string_eq(scope, attribute, value, is_not: false)
|
42
42
|
column = column_for(scope, attribute)
|
@@ -122,40 +122,40 @@ module Graphiti
|
|
122
122
|
column = column_for(scope, attribute)
|
123
123
|
scope.where(column.gt_any(value))
|
124
124
|
end
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
125
|
+
alias_method :filter_integer_gt, :filter_gt
|
126
|
+
alias_method :filter_float_gt, :filter_gt
|
127
|
+
alias_method :filter_big_decimal_gt, :filter_gt
|
128
|
+
alias_method :filter_datetime_gt, :filter_gt
|
129
|
+
alias_method :filter_date_gt, :filter_gt
|
130
130
|
|
131
131
|
def filter_gte(scope, attribute, value)
|
132
132
|
column = column_for(scope, attribute)
|
133
133
|
scope.where(column.gteq_any(value))
|
134
134
|
end
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
135
|
+
alias_method :filter_integer_gte, :filter_gte
|
136
|
+
alias_method :filter_float_gte, :filter_gte
|
137
|
+
alias_method :filter_big_decimal_gte, :filter_gte
|
138
|
+
alias_method :filter_datetime_gte, :filter_gte
|
139
|
+
alias_method :filter_date_gte, :filter_gte
|
140
140
|
|
141
141
|
def filter_lt(scope, attribute, value)
|
142
142
|
column = column_for(scope, attribute)
|
143
143
|
scope.where(column.lt_any(value))
|
144
144
|
end
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
145
|
+
alias_method :filter_integer_lt, :filter_lt
|
146
|
+
alias_method :filter_float_lt, :filter_lt
|
147
|
+
alias_method :filter_big_decimal_lt, :filter_lt
|
148
|
+
alias_method :filter_datetime_lt, :filter_lt
|
149
|
+
alias_method :filter_date_lt, :filter_lt
|
150
150
|
|
151
151
|
def filter_lte(scope, attribute, value)
|
152
152
|
column = column_for(scope, attribute)
|
153
153
|
scope.where(column.lteq_any(value))
|
154
154
|
end
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
155
|
+
alias_method :filter_integer_lte, :filter_lte
|
156
|
+
alias_method :filter_float_lte, :filter_lte
|
157
|
+
alias_method :filter_big_decimal_lte, :filter_lte
|
158
|
+
alias_method :filter_date_lte, :filter_lte
|
159
159
|
|
160
160
|
# Ensure fractional seconds don't matter
|
161
161
|
def filter_datetime_eq(scope, attribute, value, is_not: false)
|
@@ -317,7 +317,7 @@ module Graphiti
|
|
317
317
|
end
|
318
318
|
|
319
319
|
def sanitized_like_for(scope, attribute, value, &block)
|
320
|
-
escape_char =
|
320
|
+
escape_char = "\\"
|
321
321
|
column = column_for(scope, attribute)
|
322
322
|
map = value.map { |v|
|
323
323
|
v = v.downcase
|
@@ -5,22 +5,20 @@ module Graphiti
|
|
5
5
|
def process_belongs_to(persistence, attributes)
|
6
6
|
parents = [].tap do |processed|
|
7
7
|
persistence.iterate(only: [:polymorphic_belongs_to, :belongs_to]) do |x|
|
8
|
-
|
9
|
-
|
10
|
-
x[:
|
11
|
-
|
8
|
+
id = x.dig(:attributes, :id)
|
9
|
+
x[:object] = x[:resource]
|
10
|
+
.persist_with_relationships(x[:meta], x[:attributes], x[:relationships])
|
11
|
+
processed << x
|
12
|
+
rescue Graphiti::Errors::RecordNotFound
|
13
|
+
if Graphiti.config.raise_on_missing_sidepost
|
14
|
+
path = "relationships/#{x.dig(:meta, :jsonapi_type)}"
|
15
|
+
raise Graphiti::Errors::RecordNotFound.new(x[:sideload].name, id, path)
|
16
|
+
else
|
17
|
+
pointer = "data/relationships/#{x.dig(:meta, :jsonapi_type)}"
|
18
|
+
object = Graphiti::Errors::NullRelation.new(id.to_s, pointer)
|
19
|
+
object.errors.add(:base, :not_found, message: "could not be found")
|
20
|
+
x[:object] = object
|
12
21
|
processed << x
|
13
|
-
rescue Graphiti::Errors::RecordNotFound
|
14
|
-
if Graphiti.config.raise_on_missing_sidepost
|
15
|
-
path = "relationships/#{x.dig(:meta, :jsonapi_type)}"
|
16
|
-
raise Graphiti::Errors::RecordNotFound.new(x[:sideload].name, id, path)
|
17
|
-
else
|
18
|
-
pointer = "data/relationships/#{x.dig(:meta, :jsonapi_type)}"
|
19
|
-
object = Graphiti::Errors::NullRelation.new(id.to_s, pointer)
|
20
|
-
object.errors.add(:base, :not_found, message: "could not be found")
|
21
|
-
x[:object] = object
|
22
|
-
processed << x
|
23
|
-
end
|
24
22
|
end
|
25
23
|
end
|
26
24
|
end
|
@@ -13,7 +13,7 @@ module Graphiti
|
|
13
13
|
# Common interface for jsonapi-rb extensions
|
14
14
|
def as_jsonapi(*)
|
15
15
|
super.tap do |hash|
|
16
|
-
if (temp_id = @object.instance_variable_get(
|
16
|
+
if (temp_id = @object.instance_variable_get(:@_jsonapi_temp_id))
|
17
17
|
hash[:'temp-id'] = temp_id
|
18
18
|
end
|
19
19
|
end
|
@@ -192,7 +192,11 @@ module Graphiti
|
|
192
192
|
if options[:meta] && !options[:meta].empty?
|
193
193
|
if @graphql
|
194
194
|
if (stats = options[:meta][:stats])
|
195
|
-
|
195
|
+
camelized = {}
|
196
|
+
stats.each_pair do |key, value|
|
197
|
+
camelized[key.to_s.camelize(:lower).to_sym] = value
|
198
|
+
end
|
199
|
+
hash[top_level_key][:stats] = camelized
|
196
200
|
end
|
197
201
|
else
|
198
202
|
hash.merge!(options.slice(:meta))
|
data/lib/graphiti/query.rb
CHANGED
@@ -69,11 +69,9 @@ module Graphiti
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def sideload_hash
|
72
|
-
@sideload_hash =
|
73
|
-
|
74
|
-
|
75
|
-
hash[key] = sideloads[key].hash
|
76
|
-
end
|
72
|
+
@sideload_hash = {}.tap do |hash|
|
73
|
+
sideloads.each_pair do |key, value|
|
74
|
+
hash[key] = sideloads[key].hash
|
77
75
|
end
|
78
76
|
end
|
79
77
|
end
|
@@ -89,30 +87,28 @@ module Graphiti
|
|
89
87
|
end
|
90
88
|
|
91
89
|
def sideloads
|
92
|
-
@sideloads ||=
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
handle_missing_sideload(key)
|
115
|
-
end
|
90
|
+
@sideloads ||= {}.tap do |hash|
|
91
|
+
include_hash.each_pair do |key, sub_hash|
|
92
|
+
sideload = @resource.class.sideload(key)
|
93
|
+
|
94
|
+
if sideload || @resource.remote?
|
95
|
+
sl_resource = resource_for_sideload(sideload)
|
96
|
+
query_parents = parents + [self]
|
97
|
+
sub_hash = sub_hash[:include] if sub_hash.key?(:include)
|
98
|
+
|
99
|
+
# NB: To handle on__<type>--<name>
|
100
|
+
# A) relationship_name == :positions
|
101
|
+
# B) key == on__employees.positions
|
102
|
+
# This way A) ensures sideloads are resolved
|
103
|
+
# And B) ensures nested filters, sorts etc still work
|
104
|
+
relationship_name = sideload ? sideload.name : key
|
105
|
+
hash[relationship_name] = Query.new sl_resource,
|
106
|
+
@params,
|
107
|
+
key,
|
108
|
+
sub_hash,
|
109
|
+
query_parents, :all
|
110
|
+
else
|
111
|
+
handle_missing_sideload(key)
|
116
112
|
end
|
117
113
|
end
|
118
114
|
end
|
@@ -137,27 +133,25 @@ module Graphiti
|
|
137
133
|
end
|
138
134
|
|
139
135
|
def filters
|
140
|
-
@filters ||=
|
141
|
-
{}.
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
hash[filter_name] = filter_value
|
152
|
-
end
|
136
|
+
@filters ||= {}.tap do |hash|
|
137
|
+
(@params[:filter] || {}).each_pair do |name, value|
|
138
|
+
name = name.to_sym
|
139
|
+
|
140
|
+
if legacy_nested?(name)
|
141
|
+
value.keys.each do |key|
|
142
|
+
filter_name = key.to_sym
|
143
|
+
filter_value = value[key]
|
144
|
+
|
145
|
+
if @resource.get_attr!(filter_name, :filterable, request: true)
|
146
|
+
hash[filter_name] = filter_value
|
153
147
|
end
|
154
|
-
elsif nested?(name)
|
155
|
-
name = name.to_s.split(".").last.to_sym
|
156
|
-
validate!(name, :filterable)
|
157
|
-
hash[name] = value
|
158
|
-
elsif top_level? && validate!(name, :filterable)
|
159
|
-
hash[name] = value
|
160
148
|
end
|
149
|
+
elsif nested?(name)
|
150
|
+
name = name.to_s.split(".").last.to_sym
|
151
|
+
validate!(name, :filterable)
|
152
|
+
hash[name] = value
|
153
|
+
elsif top_level? && validate!(name, :filterable)
|
154
|
+
hash[name] = value
|
161
155
|
end
|
162
156
|
end
|
163
157
|
end
|
@@ -186,19 +180,17 @@ module Graphiti
|
|
186
180
|
end
|
187
181
|
|
188
182
|
def pagination
|
189
|
-
@pagination ||=
|
190
|
-
{}.
|
191
|
-
(
|
192
|
-
|
193
|
-
|
194
|
-
hash[k.to_sym] = cast_page_param(k.to_sym, v)
|
195
|
-
end
|
196
|
-
elsif nested?(name)
|
197
|
-
param_name = name.to_s.split(".").last.to_sym
|
198
|
-
hash[param_name] = cast_page_param(param_name, value)
|
199
|
-
elsif top_level? && Scoping::Paginate::PARAMS.include?(name.to_sym)
|
200
|
-
hash[name.to_sym] = cast_page_param(name.to_sym, value)
|
183
|
+
@pagination ||= {}.tap do |hash|
|
184
|
+
(@params[:page] || {}).each_pair do |name, value|
|
185
|
+
if legacy_nested?(name)
|
186
|
+
value.each_pair do |k, v|
|
187
|
+
hash[k.to_sym] = cast_page_param(k.to_sym, v)
|
201
188
|
end
|
189
|
+
elsif nested?(name)
|
190
|
+
param_name = name.to_s.split(".").last.to_sym
|
191
|
+
hash[param_name] = cast_page_param(param_name, value)
|
192
|
+
elsif top_level? && Scoping::Paginate::PARAMS.include?(name.to_sym)
|
193
|
+
hash[name.to_sym] = cast_page_param(name.to_sym, value)
|
202
194
|
end
|
203
195
|
end
|
204
196
|
end
|
@@ -221,15 +213,13 @@ module Graphiti
|
|
221
213
|
end
|
222
214
|
|
223
215
|
def stats
|
224
|
-
@stats ||=
|
225
|
-
{}.
|
226
|
-
(
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
hash[k.to_sym] = Array(v).flatten.map(&:to_sym)
|
232
|
-
end
|
216
|
+
@stats ||= {}.tap do |hash|
|
217
|
+
(@params[:stats] || {}).each_pair do |k, v|
|
218
|
+
if legacy_nested?(k)
|
219
|
+
raise NotImplementedError.new("Association statistics are not currently supported")
|
220
|
+
elsif top_level?
|
221
|
+
v = v.split(",") if v.is_a?(String)
|
222
|
+
hash[k.to_sym] = Array(v).flatten.map(&:to_sym)
|
233
223
|
end
|
234
224
|
end
|
235
225
|
end
|
data/lib/graphiti/railtie.rb
CHANGED
@@ -110,10 +110,10 @@ module Graphiti
|
|
110
110
|
end
|
111
111
|
|
112
112
|
route = begin
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
113
|
+
::Rails.application.routes.recognize_path(path, method: method)
|
114
|
+
rescue
|
115
|
+
nil
|
116
|
+
end
|
117
117
|
"#{route[:controller]}_controller".classify.safe_constantize if route
|
118
118
|
}
|
119
119
|
end
|
@@ -63,7 +63,7 @@ module Graphiti
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def sort_all(&blk)
|
66
|
-
if
|
66
|
+
if blk
|
67
67
|
config[:_sort_all] = blk
|
68
68
|
else
|
69
69
|
config[:_sort_all]
|
@@ -151,7 +151,8 @@ module Graphiti
|
|
151
151
|
readable: true,
|
152
152
|
writable: false,
|
153
153
|
sortable: false,
|
154
|
-
filterable: false
|
154
|
+
filterable: false,
|
155
|
+
schema: true
|
155
156
|
}
|
156
157
|
options = defaults.merge(options)
|
157
158
|
attribute_option(options, :readable)
|
@@ -188,9 +189,9 @@ module Graphiti
|
|
188
189
|
def attribute_option(options, name, exclusive = false)
|
189
190
|
if options[name] != false
|
190
191
|
default = if (only = options[:only]) && !exclusive
|
191
|
-
Array(only).include?(name)
|
192
|
+
Array(only).include?(name)
|
192
193
|
elsif (except = options[:except]) && !exclusive
|
193
|
-
Array(except).include?(name)
|
194
|
+
!Array(except).include?(name)
|
194
195
|
else
|
195
196
|
send(:"attributes_#{name}_by_default")
|
196
197
|
end
|
@@ -72,7 +72,7 @@ module Graphiti
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def resource_for_model(model)
|
75
|
-
resource = children.find { |c| model.
|
75
|
+
resource = children.find { |c| model.instance_of?(c.model) } ||
|
76
76
|
children.find { |c| model.is_a?(c.model) }
|
77
77
|
if resource.nil?
|
78
78
|
raise Errors::PolymorphicResourceChildNotFound.new(self, model: model)
|
@@ -71,7 +71,7 @@ module Graphiti
|
|
71
71
|
hash[:filter][:"#{as}_type"] = model_ref.name
|
72
72
|
end
|
73
73
|
|
74
|
-
instance_eval(&blk) if
|
74
|
+
instance_eval(&blk) if blk
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
@@ -85,7 +85,7 @@ module Graphiti
|
|
85
85
|
hash[:filter][:"#{as}_type"] = model_ref.name
|
86
86
|
end
|
87
87
|
|
88
|
-
instance_eval(&blk) if
|
88
|
+
instance_eval(&blk) if blk
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
data/lib/graphiti/schema.rb
CHANGED
@@ -153,6 +153,8 @@ module Graphiti
|
|
153
153
|
def extra_attributes(resource)
|
154
154
|
{}.tap do |attrs|
|
155
155
|
resource.extra_attributes.each_pair do |name, config|
|
156
|
+
next unless config[:schema]
|
157
|
+
|
156
158
|
attrs[name] = {
|
157
159
|
type: config[:type].to_s,
|
158
160
|
readable: flag(config[:readable]),
|
@@ -181,11 +183,11 @@ module Graphiti
|
|
181
183
|
def sorts(resource)
|
182
184
|
{}.tap do |s|
|
183
185
|
resource.sorts.each_pair do |name, sort|
|
184
|
-
|
186
|
+
attr = resource.all_attributes[name]
|
187
|
+
next unless attr[:schema]
|
185
188
|
|
186
189
|
config = {}
|
187
190
|
config[:only] = sort[:only] if sort[:only]
|
188
|
-
attr = resource.attributes[name]
|
189
191
|
if attr[:sortable].is_a?(Symbol)
|
190
192
|
config[:guard] = true
|
191
193
|
end
|
@@ -209,7 +211,7 @@ module Graphiti
|
|
209
211
|
config[:deny] = filter[:deny].map(&:to_s) if filter[:deny]
|
210
212
|
config[:dependencies] = filter[:dependencies].map(&:to_s) if filter[:dependencies]
|
211
213
|
|
212
|
-
attr = resource.
|
214
|
+
attr = resource.all_attributes[name]
|
213
215
|
if attr[:filterable].is_a?(Symbol)
|
214
216
|
if attr[:filterable] == :required
|
215
217
|
config[:required] = true
|
@@ -59,12 +59,10 @@ module Graphiti
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def sort_param
|
62
|
-
@sort_param ||=
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
normalize(query_hash[:sort])
|
67
|
-
end
|
62
|
+
@sort_param ||= if query_hash[:sort].blank?
|
63
|
+
resource.default_sort || []
|
64
|
+
else
|
65
|
+
normalize(query_hash[:sort])
|
68
66
|
end
|
69
67
|
end
|
70
68
|
|
@@ -7,7 +7,6 @@ class Graphiti::Sideload::PolymorphicBelongsTo < Graphiti::Sideload::BelongsTo
|
|
7
7
|
@calls = []
|
8
8
|
end
|
9
9
|
|
10
|
-
# rubocop: disable Style/MethodMissingSuper
|
11
10
|
def method_missing(name, *args, &blk)
|
12
11
|
@calls << [name, args, blk]
|
13
12
|
end
|
@@ -56,9 +55,9 @@ class Graphiti::Sideload::PolymorphicBelongsTo < Graphiti::Sideload::BelongsTo
|
|
56
55
|
args = call[1]
|
57
56
|
opts = args.extract_options!
|
58
57
|
opts.merge! as: sideload.name,
|
59
|
-
|
60
|
-
|
61
|
-
|
58
|
+
parent: sideload,
|
59
|
+
group_name: group.name,
|
60
|
+
polymorphic_child: true
|
62
61
|
unless sideload.resource.class.abstract_class?
|
63
62
|
opts[:foreign_key] ||= sideload.foreign_key
|
64
63
|
opts[:primary_key] ||= sideload.primary_key
|
data/lib/graphiti/stats/dsl.rb
CHANGED
@@ -33,7 +33,7 @@ module Graphiti
|
|
33
33
|
def size
|
34
34
|
values.flatten.size
|
35
35
|
end
|
36
|
-
|
36
|
+
alias_method :count, :size
|
37
37
|
|
38
38
|
def values
|
39
39
|
messages.values.reject(&:empty?)
|
@@ -48,7 +48,7 @@ module Graphiti
|
|
48
48
|
def empty?
|
49
49
|
size.zero?
|
50
50
|
end
|
51
|
-
|
51
|
+
alias_method :blank?, :empty?
|
52
52
|
|
53
53
|
def add(attribute, code, message: nil)
|
54
54
|
message ||= "is #{code.to_s.humanize.downcase}"
|
@@ -64,7 +64,7 @@ module Graphiti
|
|
64
64
|
def full_messages
|
65
65
|
map { |attribute, message| full_message(attribute, message) }
|
66
66
|
end
|
67
|
-
|
67
|
+
alias_method :to_a, :full_messages
|
68
68
|
|
69
69
|
def full_messages_for(attribute)
|
70
70
|
attribute = attribute.to_sym
|
data/lib/graphiti/version.rb
CHANGED
data/lib/graphiti.rb
CHANGED
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.3.
|
4
|
+
version: 1.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-serializable
|
@@ -98,14 +98,14 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - ">="
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: '
|
101
|
+
version: '5.2'
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
106
|
- - ">="
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version: '
|
108
|
+
version: '5.2'
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: faraday
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,44 +152,44 @@ dependencies:
|
|
152
152
|
name: rake
|
153
153
|
requirement: !ruby/object:Gem::Requirement
|
154
154
|
requirements:
|
155
|
-
- - "
|
155
|
+
- - ">="
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '10.0'
|
158
158
|
type: :development
|
159
159
|
prerelease: false
|
160
160
|
version_requirements: !ruby/object:Gem::Requirement
|
161
161
|
requirements:
|
162
|
-
- - "
|
162
|
+
- - ">="
|
163
163
|
- !ruby/object:Gem::Version
|
164
164
|
version: '10.0'
|
165
165
|
- !ruby/object:Gem::Dependency
|
166
166
|
name: standard
|
167
167
|
requirement: !ruby/object:Gem::Requirement
|
168
168
|
requirements:
|
169
|
-
- -
|
169
|
+
- - "~>"
|
170
170
|
- !ruby/object:Gem::Version
|
171
|
-
version:
|
171
|
+
version: 1.4.0
|
172
172
|
type: :development
|
173
173
|
prerelease: false
|
174
174
|
version_requirements: !ruby/object:Gem::Requirement
|
175
175
|
requirements:
|
176
|
-
- -
|
176
|
+
- - "~>"
|
177
177
|
- !ruby/object:Gem::Version
|
178
|
-
version:
|
178
|
+
version: 1.4.0
|
179
179
|
- !ruby/object:Gem::Dependency
|
180
180
|
name: activemodel
|
181
181
|
requirement: !ruby/object:Gem::Requirement
|
182
182
|
requirements:
|
183
183
|
- - ">="
|
184
184
|
- !ruby/object:Gem::Version
|
185
|
-
version: '
|
185
|
+
version: '5.2'
|
186
186
|
type: :development
|
187
187
|
prerelease: false
|
188
188
|
version_requirements: !ruby/object:Gem::Requirement
|
189
189
|
requirements:
|
190
190
|
- - ">="
|
191
191
|
- !ruby/object:Gem::Version
|
192
|
-
version: '
|
192
|
+
version: '5.2'
|
193
193
|
- !ruby/object:Gem::Dependency
|
194
194
|
name: graphiti_spec_helpers
|
195
195
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,10 +212,10 @@ executables:
|
|
212
212
|
extensions: []
|
213
213
|
extra_rdoc_files: []
|
214
214
|
files:
|
215
|
+
- ".github/workflows/ci.yml"
|
215
216
|
- ".gitignore"
|
216
217
|
- ".rspec"
|
217
218
|
- ".standard.yml"
|
218
|
-
- ".travis.yml"
|
219
219
|
- ".yardopts"
|
220
220
|
- Appraisals
|
221
221
|
- CHANGELOG.md
|
@@ -246,15 +246,12 @@ files:
|
|
246
246
|
- deprecated_generators/graphiti/templates/update_request_spec.rb.erb
|
247
247
|
- exe/graphiti
|
248
248
|
- gemfiles/.bundle/config
|
249
|
-
- gemfiles/rails_4.gemfile
|
250
|
-
- gemfiles/rails_5_0.gemfile
|
251
|
-
- gemfiles/rails_5_0_graphiti_rails.gemfile
|
252
|
-
- gemfiles/rails_5_1.gemfile
|
253
|
-
- gemfiles/rails_5_1_graphiti_rails.gemfile
|
254
249
|
- gemfiles/rails_5_2.gemfile
|
255
250
|
- gemfiles/rails_5_2_graphiti_rails.gemfile
|
256
251
|
- gemfiles/rails_6.gemfile
|
257
252
|
- gemfiles/rails_6_graphiti_rails.gemfile
|
253
|
+
- gemfiles/rails_7.gemfile
|
254
|
+
- gemfiles/rails_7_graphiti_rails.gemfile
|
258
255
|
- graphiti.gemspec
|
259
256
|
- lib/graphiti.rb
|
260
257
|
- lib/graphiti/adapters/abstract.rb
|
@@ -351,17 +348,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
351
348
|
requirements:
|
352
349
|
- - ">="
|
353
350
|
- !ruby/object:Gem::Version
|
354
|
-
version: '2.
|
355
|
-
- - "<"
|
356
|
-
- !ruby/object:Gem::Version
|
357
|
-
version: '3.1'
|
351
|
+
version: '2.6'
|
358
352
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
359
353
|
requirements:
|
360
354
|
- - ">="
|
361
355
|
- !ruby/object:Gem::Version
|
362
356
|
version: '0'
|
363
357
|
requirements: []
|
364
|
-
rubygems_version: 3.
|
358
|
+
rubygems_version: 3.3.7
|
365
359
|
signing_key:
|
366
360
|
specification_version: 4
|
367
361
|
summary: Easily build jsonapi.org-compatible APIs
|
data/.travis.yml
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
rvm:
|
4
|
-
- 2.5
|
5
|
-
- 2.6
|
6
|
-
- 2.7
|
7
|
-
gemfile:
|
8
|
-
- Gemfile
|
9
|
-
- gemfiles/rails_4.gemfile
|
10
|
-
- gemfiles/rails_5_0.gemfile
|
11
|
-
- gemfiles/rails_5_1.gemfile
|
12
|
-
- gemfiles/rails_5_2.gemfile
|
13
|
-
- gemfiles/rails_6.gemfile
|
14
|
-
- gemfiles/rails_5_0_graphiti_rails.gemfile
|
15
|
-
- gemfiles/rails_5_1_graphiti_rails.gemfile
|
16
|
-
- gemfiles/rails_5_2_graphiti_rails.gemfile
|
17
|
-
- gemfiles/rails_6_graphiti_rails.gemfile
|
18
|
-
env:
|
19
|
-
- COMMAND="standardrb --no-fix --format progress"
|
20
|
-
- COMMAND=rspec
|
21
|
-
- COMMAND=rspec APPRAISAL_INITIALIZED=true
|
22
|
-
jobs:
|
23
|
-
allow_failures:
|
24
|
-
- rvm: ruby-head
|
25
|
-
include:
|
26
|
-
- env: COMMAND=rspec
|
27
|
-
gemfile: Gemfile
|
28
|
-
rvm: ruby-head
|
29
|
-
exclude:
|
30
|
-
# Don't run the appraisal version of the specs for the base gemfile
|
31
|
-
- env: COMMAND=rspec APPRAISAL_INITIALIZED=true
|
32
|
-
gemfile: Gemfile
|
33
|
-
# Don't run the standardrb check on any gemfile except the base gemfile
|
34
|
-
# (but run it for each ruby version)
|
35
|
-
- env: COMMAND="standardrb --no-fix --format progress"
|
36
|
-
gemfile: gemfiles/rails_4.gemfile
|
37
|
-
- env: COMMAND="standardrb --no-fix --format progress"
|
38
|
-
gemfile: gemfiles/rails_5_0.gemfile
|
39
|
-
- env: COMMAND="standardrb --no-fix --format progress"
|
40
|
-
gemfile: gemfiles/rails_5_1.gemfile
|
41
|
-
- env: COMMAND="standardrb --no-fix --format progress"
|
42
|
-
gemfile: gemfiles/rails_5_2.gemfile
|
43
|
-
- env: COMMAND="standardrb --no-fix --format progress"
|
44
|
-
gemfile: gemfiles/rails_6.gemfile
|
45
|
-
- env: COMMAND="standardrb --no-fix --format progress"
|
46
|
-
gemfile: gemfiles/rails_5_0_graphiti_rails.gemfile
|
47
|
-
- env: COMMAND="standardrb --no-fix --format progress"
|
48
|
-
gemfile: gemfiles/rails_5_1_graphiti_rails.gemfile
|
49
|
-
- env: COMMAND="standardrb --no-fix --format progress"
|
50
|
-
gemfile: gemfiles/rails_5_2_graphiti_rails.gemfile
|
51
|
-
- env: COMMAND="standardrb --no-fix --format progress"
|
52
|
-
gemfile: gemfiles/rails_6_graphiti_rails.gemfile
|
53
|
-
# Don't run the basic versions of the specs for any of the specific gemfiles
|
54
|
-
- env: COMMAND=rspec
|
55
|
-
gemfile: gemfiles/rails_4.gemfile
|
56
|
-
- env: COMMAND=rspec
|
57
|
-
gemfile: gemfiles/rails_5_0.gemfile
|
58
|
-
- env: COMMAND=rspec
|
59
|
-
gemfile: gemfiles/rails_5_1.gemfile
|
60
|
-
- env: COMMAND=rspec
|
61
|
-
gemfile: gemfiles/rails_5_2.gemfile
|
62
|
-
- env: COMMAND=rspec
|
63
|
-
gemfile: gemfiles/rails_6.gemfile
|
64
|
-
- env: COMMAND=rspec
|
65
|
-
gemfile: gemfiles/rails_5_0_graphiti_rails.gemfile
|
66
|
-
- env: COMMAND=rspec
|
67
|
-
gemfile: gemfiles/rails_5_1_graphiti_rails.gemfile
|
68
|
-
- env: COMMAND=rspec
|
69
|
-
gemfile: gemfiles/rails_5_2_graphiti_rails.gemfile
|
70
|
-
- env: COMMAND=rspec
|
71
|
-
gemfile: gemfiles/rails_6_graphiti_rails.gemfile
|
72
|
-
|
73
|
-
# Don't run rails 4 egmfile against any rubies (for some reason?)
|
74
|
-
- gemfile: gemfiles/rails_4.gemfile
|
75
|
-
rvm: 2.5
|
76
|
-
- gemfile: gemfiles/rails_4.gemfile
|
77
|
-
rvm: 2.6
|
78
|
-
- gemfile: gemfiles/rails_4.gemfile
|
79
|
-
rvm: 2.7
|
80
|
-
|
81
|
-
script:
|
82
|
-
- bundle _1.17.3_ exec $COMMAND
|
83
|
-
|
84
|
-
install: bundle _1.17.3_ install --retry=3 --jobs=3
|
85
|
-
before_install:
|
86
|
-
- gem install bundler -v '1.17.3'
|
87
|
-
deploy:
|
88
|
-
provider: rubygems
|
89
|
-
api_key:
|
90
|
-
secure: aON6EPWgHZXVQs+n/glMjPJ5kMpeR25khDpYlFIM0Ggf2+xuT/yRMtGbNTYnB01v/v2s9tNWK6QlMGARCbKz/W6WS8VNwFxs4DO1IPY3XoyF8QaPlXVKfBLldjUoVx61zL5xtcv8uZqWT1ATY+DjHW3nQ875ss/GW8tw+UASG1uUEuPCE9z+rNa3xYnm2qSZOwhFWqs5bHRQcc3gF3O8Hy8r4aosYTAlYOSeGDToqTUq1Ws21dV4xnIo97Nhmh9SYBQcKpZk1qF9bUz4zqdKsDKAxHMJRShtILmhPxNpIqE5ZV0+Xt+cnwi11AZDhSgfoUqYO9t2uG562luAqTnEZEQl+Lmc+nx4nJTH6tcR3ri301k0O+qDZ3PgSojJvrUuNC8DDLbbsVJNHYycGOLclqQq1aNbgz9HayEE5s+AyklPcprJhngxA5WP80AtONAxxLt4OjrY0X80TvOi2b5nfIN7DowGmcLbRahnms98Yk6/i1vCNV4R9bO0AaqpGLV+L8sVp98Qquk2mpvB3Le4W89qm5int1y2FNJbgInBpY1UOsI3wLENt0npC1X/KVMJKkpHvk80rGccI5FIVRUDZ3YD77hi+s1busPSVQ/+l4QdTFHmWp13Pghf6hNaIwfNwFMHwM2Fkv8YXa4c1mWc1cY5WP1ELS8cEnjtmp/9Iuc=
|
91
|
-
gem: graphiti
|
92
|
-
on:
|
93
|
-
tags: true
|
94
|
-
repo: graphiti-api/graphiti
|
data/gemfiles/rails_5_0.gemfile
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "rails", "~> 5.0"
|
6
|
-
gem "rspec-rails"
|
7
|
-
gem "sqlite3", "~> 1.3.6"
|
8
|
-
gem "database_cleaner"
|
9
|
-
|
10
|
-
group :test do
|
11
|
-
gem "pry"
|
12
|
-
gem "pry-byebug", platform: [:mri]
|
13
|
-
gem "appraisal"
|
14
|
-
gem "guard"
|
15
|
-
gem "guard-rspec"
|
16
|
-
end
|
17
|
-
|
18
|
-
gemspec path: "../"
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "rails", "~> 5.0"
|
6
|
-
gem "rspec-rails"
|
7
|
-
gem "sqlite3", "~> 1.3.6"
|
8
|
-
gem "database_cleaner"
|
9
|
-
gem "rescue_registry", git: "https://github.com/wagenet/rescue_registry.git", branch: "master"
|
10
|
-
gem "graphiti-rails", git: "https://github.com/wagenet/graphiti-rails.git", branch: "master"
|
11
|
-
|
12
|
-
group :test do
|
13
|
-
gem "pry"
|
14
|
-
gem "pry-byebug", platform: [:mri]
|
15
|
-
gem "appraisal"
|
16
|
-
gem "guard"
|
17
|
-
gem "guard-rspec"
|
18
|
-
end
|
19
|
-
|
20
|
-
gemspec path: "../"
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "rails", "~> 5.1"
|
6
|
-
gem "rspec-rails"
|
7
|
-
gem "sqlite3", "~> 1.3.6"
|
8
|
-
gem "database_cleaner"
|
9
|
-
gem "rescue_registry", git: "https://github.com/wagenet/rescue_registry.git", branch: "master"
|
10
|
-
gem "graphiti-rails", git: "https://github.com/wagenet/graphiti-rails.git", branch: "master"
|
11
|
-
|
12
|
-
group :test do
|
13
|
-
gem "pry"
|
14
|
-
gem "pry-byebug", platform: [:mri]
|
15
|
-
gem "appraisal"
|
16
|
-
gem "guard"
|
17
|
-
gem "guard-rspec"
|
18
|
-
end
|
19
|
-
|
20
|
-
gemspec path: "../"
|