jsonapi_actions 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +75 -75
- data/jsonapi_actions.gemspec +1 -1
- data/lib/jsonapi_actions/version.rb +1 -1
- data/lib/jsonapi_actions.rb +10 -16
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5565cb462ad2ab745d869fca29361b1c89a44971f113798018daa83e57968d85
|
4
|
+
data.tar.gz: 48f0986b798c14456211e08414ceb620f56bde53011247c3409230057964c3d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0d2a68fd3c6ba77c676cf5cb3093b1c27e4fe908d224923409a4100afe1a7734a21d3412050c51dc0d52337df456a77bc00c0cf68c1df8c0b7e723246037b4e
|
7
|
+
data.tar.gz: a76ef4cebec31d45817efc50cf227cc5a685d1bca87c3876212042e23b68cc56fa9933211dc011b0f59ae05a2eb3664978c7594e25bf54b6b24bfe33a0691db6
|
data/Gemfile.lock
CHANGED
@@ -8,127 +8,127 @@ PATH
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actioncable (6.0.
|
12
|
-
actionpack (= 6.0.
|
11
|
+
actioncable (6.0.2.2)
|
12
|
+
actionpack (= 6.0.2.2)
|
13
13
|
nio4r (~> 2.0)
|
14
14
|
websocket-driver (>= 0.6.1)
|
15
|
-
actionmailbox (6.0.
|
16
|
-
actionpack (= 6.0.
|
17
|
-
activejob (= 6.0.
|
18
|
-
activerecord (= 6.0.
|
19
|
-
activestorage (= 6.0.
|
20
|
-
activesupport (= 6.0.
|
15
|
+
actionmailbox (6.0.2.2)
|
16
|
+
actionpack (= 6.0.2.2)
|
17
|
+
activejob (= 6.0.2.2)
|
18
|
+
activerecord (= 6.0.2.2)
|
19
|
+
activestorage (= 6.0.2.2)
|
20
|
+
activesupport (= 6.0.2.2)
|
21
21
|
mail (>= 2.7.1)
|
22
|
-
actionmailer (6.0.
|
23
|
-
actionpack (= 6.0.
|
24
|
-
actionview (= 6.0.
|
25
|
-
activejob (= 6.0.
|
22
|
+
actionmailer (6.0.2.2)
|
23
|
+
actionpack (= 6.0.2.2)
|
24
|
+
actionview (= 6.0.2.2)
|
25
|
+
activejob (= 6.0.2.2)
|
26
26
|
mail (~> 2.5, >= 2.5.4)
|
27
27
|
rails-dom-testing (~> 2.0)
|
28
|
-
actionpack (6.0.
|
29
|
-
actionview (= 6.0.
|
30
|
-
activesupport (= 6.0.
|
31
|
-
rack (~> 2.0)
|
28
|
+
actionpack (6.0.2.2)
|
29
|
+
actionview (= 6.0.2.2)
|
30
|
+
activesupport (= 6.0.2.2)
|
31
|
+
rack (~> 2.0, >= 2.0.8)
|
32
32
|
rack-test (>= 0.6.3)
|
33
33
|
rails-dom-testing (~> 2.0)
|
34
34
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
35
|
-
actiontext (6.0.
|
36
|
-
actionpack (= 6.0.
|
37
|
-
activerecord (= 6.0.
|
38
|
-
activestorage (= 6.0.
|
39
|
-
activesupport (= 6.0.
|
35
|
+
actiontext (6.0.2.2)
|
36
|
+
actionpack (= 6.0.2.2)
|
37
|
+
activerecord (= 6.0.2.2)
|
38
|
+
activestorage (= 6.0.2.2)
|
39
|
+
activesupport (= 6.0.2.2)
|
40
40
|
nokogiri (>= 1.8.5)
|
41
|
-
actionview (6.0.
|
42
|
-
activesupport (= 6.0.
|
41
|
+
actionview (6.0.2.2)
|
42
|
+
activesupport (= 6.0.2.2)
|
43
43
|
builder (~> 3.1)
|
44
44
|
erubi (~> 1.4)
|
45
45
|
rails-dom-testing (~> 2.0)
|
46
46
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
47
|
-
activejob (6.0.
|
48
|
-
activesupport (= 6.0.
|
47
|
+
activejob (6.0.2.2)
|
48
|
+
activesupport (= 6.0.2.2)
|
49
49
|
globalid (>= 0.3.6)
|
50
|
-
activemodel (6.0.
|
51
|
-
activesupport (= 6.0.
|
52
|
-
activerecord (6.0.
|
53
|
-
activemodel (= 6.0.
|
54
|
-
activesupport (= 6.0.
|
55
|
-
activestorage (6.0.
|
56
|
-
actionpack (= 6.0.
|
57
|
-
activejob (= 6.0.
|
58
|
-
activerecord (= 6.0.
|
50
|
+
activemodel (6.0.2.2)
|
51
|
+
activesupport (= 6.0.2.2)
|
52
|
+
activerecord (6.0.2.2)
|
53
|
+
activemodel (= 6.0.2.2)
|
54
|
+
activesupport (= 6.0.2.2)
|
55
|
+
activestorage (6.0.2.2)
|
56
|
+
actionpack (= 6.0.2.2)
|
57
|
+
activejob (= 6.0.2.2)
|
58
|
+
activerecord (= 6.0.2.2)
|
59
59
|
marcel (~> 0.3.1)
|
60
|
-
activesupport (6.0.
|
60
|
+
activesupport (6.0.2.2)
|
61
61
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
62
62
|
i18n (>= 0.7, < 2)
|
63
63
|
minitest (~> 5.1)
|
64
64
|
tzinfo (~> 1.1)
|
65
65
|
zeitwerk (~> 2.2)
|
66
|
-
builder (3.2.
|
67
|
-
concurrent-ruby (1.1.
|
68
|
-
crass (1.0.
|
66
|
+
builder (3.2.4)
|
67
|
+
concurrent-ruby (1.1.6)
|
68
|
+
crass (1.0.6)
|
69
69
|
diff-lcs (1.3)
|
70
70
|
erubi (1.9.0)
|
71
71
|
globalid (0.4.2)
|
72
72
|
activesupport (>= 4.2.0)
|
73
|
-
i18n (1.
|
73
|
+
i18n (1.8.2)
|
74
74
|
concurrent-ruby (~> 1.0)
|
75
|
-
kaminari (1.
|
75
|
+
kaminari (1.2.0)
|
76
76
|
activesupport (>= 4.1.0)
|
77
|
-
kaminari-actionview (= 1.
|
78
|
-
kaminari-activerecord (= 1.
|
79
|
-
kaminari-core (= 1.
|
80
|
-
kaminari-actionview (1.
|
77
|
+
kaminari-actionview (= 1.2.0)
|
78
|
+
kaminari-activerecord (= 1.2.0)
|
79
|
+
kaminari-core (= 1.2.0)
|
80
|
+
kaminari-actionview (1.2.0)
|
81
81
|
actionview
|
82
|
-
kaminari-core (= 1.
|
83
|
-
kaminari-activerecord (1.
|
82
|
+
kaminari-core (= 1.2.0)
|
83
|
+
kaminari-activerecord (1.2.0)
|
84
84
|
activerecord
|
85
|
-
kaminari-core (= 1.
|
86
|
-
kaminari-core (1.
|
87
|
-
loofah (2.
|
85
|
+
kaminari-core (= 1.2.0)
|
86
|
+
kaminari-core (1.2.0)
|
87
|
+
loofah (2.4.0)
|
88
88
|
crass (~> 1.0.2)
|
89
89
|
nokogiri (>= 1.5.9)
|
90
90
|
mail (2.7.1)
|
91
91
|
mini_mime (>= 0.1.1)
|
92
92
|
marcel (0.3.3)
|
93
93
|
mimemagic (~> 0.3.2)
|
94
|
-
method_source (0.
|
95
|
-
mimemagic (0.3.
|
94
|
+
method_source (1.0.0)
|
95
|
+
mimemagic (0.3.4)
|
96
96
|
mini_mime (1.0.2)
|
97
97
|
mini_portile2 (2.4.0)
|
98
|
-
minitest (5.
|
98
|
+
minitest (5.14.0)
|
99
99
|
nio4r (2.5.2)
|
100
|
-
nokogiri (1.10.
|
100
|
+
nokogiri (1.10.9)
|
101
101
|
mini_portile2 (~> 2.4.0)
|
102
|
-
rack (2.
|
102
|
+
rack (2.2.2)
|
103
103
|
rack-test (1.1.0)
|
104
104
|
rack (>= 1.0, < 3)
|
105
|
-
rails (6.0.
|
106
|
-
actioncable (= 6.0.
|
107
|
-
actionmailbox (= 6.0.
|
108
|
-
actionmailer (= 6.0.
|
109
|
-
actionpack (= 6.0.
|
110
|
-
actiontext (= 6.0.
|
111
|
-
actionview (= 6.0.
|
112
|
-
activejob (= 6.0.
|
113
|
-
activemodel (= 6.0.
|
114
|
-
activerecord (= 6.0.
|
115
|
-
activestorage (= 6.0.
|
116
|
-
activesupport (= 6.0.
|
105
|
+
rails (6.0.2.2)
|
106
|
+
actioncable (= 6.0.2.2)
|
107
|
+
actionmailbox (= 6.0.2.2)
|
108
|
+
actionmailer (= 6.0.2.2)
|
109
|
+
actionpack (= 6.0.2.2)
|
110
|
+
actiontext (= 6.0.2.2)
|
111
|
+
actionview (= 6.0.2.2)
|
112
|
+
activejob (= 6.0.2.2)
|
113
|
+
activemodel (= 6.0.2.2)
|
114
|
+
activerecord (= 6.0.2.2)
|
115
|
+
activestorage (= 6.0.2.2)
|
116
|
+
activesupport (= 6.0.2.2)
|
117
117
|
bundler (>= 1.3.0)
|
118
|
-
railties (= 6.0.
|
118
|
+
railties (= 6.0.2.2)
|
119
119
|
sprockets-rails (>= 2.0.0)
|
120
120
|
rails-dom-testing (2.0.3)
|
121
121
|
activesupport (>= 4.2.0)
|
122
122
|
nokogiri (>= 1.6)
|
123
123
|
rails-html-sanitizer (1.3.0)
|
124
124
|
loofah (~> 2.3)
|
125
|
-
railties (6.0.
|
126
|
-
actionpack (= 6.0.
|
127
|
-
activesupport (= 6.0.
|
125
|
+
railties (6.0.2.2)
|
126
|
+
actionpack (= 6.0.2.2)
|
127
|
+
activesupport (= 6.0.2.2)
|
128
128
|
method_source
|
129
129
|
rake (>= 0.8.7)
|
130
130
|
thor (>= 0.20.3, < 2.0)
|
131
|
-
rake (
|
131
|
+
rake (13.0.1)
|
132
132
|
rspec (3.8.0)
|
133
133
|
rspec-core (~> 3.8.0)
|
134
134
|
rspec-expectations (~> 3.8.0)
|
@@ -149,14 +149,14 @@ GEM
|
|
149
149
|
actionpack (>= 4.0)
|
150
150
|
activesupport (>= 4.0)
|
151
151
|
sprockets (>= 3.0.0)
|
152
|
-
thor (0.
|
152
|
+
thor (1.0.1)
|
153
153
|
thread_safe (0.3.6)
|
154
|
-
tzinfo (1.2.
|
154
|
+
tzinfo (1.2.6)
|
155
155
|
thread_safe (~> 0.1)
|
156
156
|
websocket-driver (0.7.1)
|
157
157
|
websocket-extensions (>= 0.1.0)
|
158
158
|
websocket-extensions (0.1.4)
|
159
|
-
zeitwerk (2.
|
159
|
+
zeitwerk (2.3.0)
|
160
160
|
|
161
161
|
PLATFORMS
|
162
162
|
ruby
|
@@ -164,7 +164,7 @@ PLATFORMS
|
|
164
164
|
DEPENDENCIES
|
165
165
|
bundler (~> 2.0)
|
166
166
|
jsonapi_actions!
|
167
|
-
rake (~>
|
167
|
+
rake (~> 13.0)
|
168
168
|
rspec (~> 3.0)
|
169
169
|
|
170
170
|
BUNDLED WITH
|
data/jsonapi_actions.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.require_paths = ["lib"]
|
25
25
|
|
26
26
|
spec.add_development_dependency "bundler", "~> 2.0"
|
27
|
-
spec.add_development_dependency "rake", "~>
|
27
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
28
28
|
spec.add_development_dependency "rspec", "~> 3.0"
|
29
29
|
|
30
30
|
spec.add_dependency 'rails', '>= 4.0', '< 7.0'
|
data/lib/jsonapi_actions.rb
CHANGED
@@ -194,27 +194,21 @@ module JsonapiActions
|
|
194
194
|
end
|
195
195
|
|
196
196
|
def serializer(data = nil)
|
197
|
-
if self.class.serializer
|
198
|
-
self.class.serializer
|
199
|
-
else
|
200
|
-
"#{model.name}Serializer".constantize
|
201
|
-
end
|
202
|
-
|
203
|
-
rescue NoMethodError, NameError
|
204
|
-
serializer_lookup(data)
|
205
|
-
end
|
206
|
-
|
207
|
-
def serializer_lookup(data)
|
208
197
|
serializer_classes = [
|
198
|
+
self.class.serializer,
|
209
199
|
data.try(:serializer_class),
|
210
|
-
"#{data.class.
|
200
|
+
"#{data.class.name}Serializer".safe_constantize,
|
211
201
|
data.try(:first).try(:serializer_class),
|
212
|
-
"#{data.try(:first).class.
|
202
|
+
"#{data.try(:first).class.name}Serializer".safe_constantize
|
213
203
|
].compact
|
214
204
|
|
215
|
-
|
216
|
-
|
217
|
-
|
205
|
+
if serializer_classes.any?
|
206
|
+
serializer_classes.first
|
207
|
+
else
|
208
|
+
"#{model.name}Serializer".safe_constantize
|
209
|
+
end
|
210
|
+
rescue NoMethodError, NameError
|
211
|
+
raise 'Unknown serializer'
|
218
212
|
end
|
219
213
|
|
220
214
|
def eager_load(records)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi_actions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Pheasey
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|