graphiti 1.2.44 → 1.3.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +96 -0
  3. data/.standard.yml +4 -4
  4. data/Appraisals +18 -44
  5. data/CHANGELOG.md +1 -0
  6. data/gemfiles/rails_5_2.gemfile +2 -2
  7. data/gemfiles/rails_5_2_graphiti_rails.gemfile +3 -4
  8. data/gemfiles/rails_6_graphiti_rails.gemfile +1 -2
  9. data/gemfiles/{rails_5_1.gemfile → rails_7.gemfile} +2 -2
  10. data/gemfiles/{rails_4.gemfile → rails_7_graphiti_rails.gemfile} +3 -2
  11. data/graphiti.gemspec +5 -5
  12. data/lib/graphiti/adapters/abstract.rb +5 -1
  13. data/lib/graphiti/adapters/active_record.rb +42 -34
  14. data/lib/graphiti/adapters/persistence/associations.rb +13 -15
  15. data/lib/graphiti/delegates/pagination.rb +14 -6
  16. data/lib/graphiti/errors.rb +17 -11
  17. data/lib/graphiti/extensions/temp_id.rb +1 -1
  18. data/lib/graphiti/filter_operators.rb +0 -1
  19. data/lib/graphiti/hash_renderer.rb +40 -2
  20. data/lib/graphiti/query.rb +71 -68
  21. data/lib/graphiti/railtie.rb +4 -4
  22. data/lib/graphiti/renderer.rb +1 -0
  23. data/lib/graphiti/request_validator.rb +1 -1
  24. data/lib/graphiti/resource/configuration.rb +2 -1
  25. data/lib/graphiti/resource/dsl.rb +14 -6
  26. data/lib/graphiti/resource/polymorphism.rb +1 -1
  27. data/lib/graphiti/resource/sideloading.rb +4 -4
  28. data/lib/graphiti/resource.rb +2 -1
  29. data/lib/graphiti/resource_proxy.rb +8 -2
  30. data/lib/graphiti/schema.rb +6 -4
  31. data/lib/graphiti/scope.rb +2 -2
  32. data/lib/graphiti/scoping/paginate.rb +28 -2
  33. data/lib/graphiti/scoping/sort.rb +4 -6
  34. data/lib/graphiti/serializer.rb +19 -1
  35. data/lib/graphiti/sideload/polymorphic_belongs_to.rb +3 -4
  36. data/lib/graphiti/stats/dsl.rb +0 -1
  37. data/lib/graphiti/util/serializer_attributes.rb +6 -0
  38. data/lib/graphiti/util/simple_errors.rb +3 -3
  39. data/lib/graphiti/version.rb +1 -1
  40. data/lib/graphiti.rb +1 -0
  41. metadata +17 -23
  42. data/.travis.yml +0 -94
  43. data/gemfiles/rails_5_0.gemfile +0 -18
  44. data/gemfiles/rails_5_0_graphiti_rails.gemfile +0 -20
  45. data/gemfiles/rails_5_1_graphiti_rails.gemfile +0 -20
@@ -33,7 +33,7 @@ module Graphiti
33
33
  def size
34
34
  values.flatten.size
35
35
  end
36
- alias count size
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
- alias blank? empty?
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
- alias to_a full_messages
67
+ alias_method :to_a, :full_messages
68
68
 
69
69
  def full_messages_for(attribute)
70
70
  attribute = attribute.to_sym
@@ -1,3 +1,3 @@
1
1
  module Graphiti
2
- VERSION = "1.2.44"
2
+ VERSION = "1.3.9"
3
3
  end
data/lib/graphiti.rb CHANGED
@@ -208,6 +208,7 @@ module InstanceVariableOverride
208
208
  values
209
209
  end
210
210
  end
211
+
211
212
  class Object
212
213
  prepend InstanceVariableOverride
213
214
  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.2.44
4
+ version: 1.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-25 00:00:00.000000000 Z
11
+ date: 2022-05-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: '4.1'
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: '4.1'
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: 0.4.7
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: 0.4.7
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: '4.1'
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: '4.1'
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.3'
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.0.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
@@ -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: "../"