active_record_api-rest 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +85 -85
- data/lib/active_record_api/rest/index_controller.rb +8 -5
- data/lib/active_record_api/rest/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c5aa165447aaf0f8949ece6962db3ef0136eb9e027cec4a16d95f5561d0c7c3
|
4
|
+
data.tar.gz: '056273771414309c4a36a13ba1832a06f79bed140db1b171cdee18e4937d4bac'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 441b71b2ae9b0af5874c3a916fee6c6ad55bbb7903753a416efcd55374ddaa1b565d2987b9200d31c9f40574a0316377351b6c8629375485c35b7361fe36aceb
|
7
|
+
data.tar.gz: 7981855e67a1f2cf08099938aee5cae43a2f312fe0b1b81a76d83583fb5c093de4e07f17a8c03489a5c5de47d936d67994583994446d952e17c5b2f66183f16d
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
active_record_api-rest (0.1.
|
4
|
+
active_record_api-rest (0.1.8)
|
5
5
|
active_attr
|
6
6
|
active_model_serializers
|
7
7
|
cancancan
|
@@ -10,162 +10,162 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
actioncable (5.2.
|
14
|
-
actionpack (= 5.2.
|
13
|
+
actioncable (5.2.2)
|
14
|
+
actionpack (= 5.2.2)
|
15
15
|
nio4r (~> 2.0)
|
16
16
|
websocket-driver (>= 0.6.1)
|
17
|
-
actionmailer (5.2.
|
18
|
-
actionpack (= 5.2.
|
19
|
-
actionview (= 5.2.
|
20
|
-
activejob (= 5.2.
|
17
|
+
actionmailer (5.2.2)
|
18
|
+
actionpack (= 5.2.2)
|
19
|
+
actionview (= 5.2.2)
|
20
|
+
activejob (= 5.2.2)
|
21
21
|
mail (~> 2.5, >= 2.5.4)
|
22
22
|
rails-dom-testing (~> 2.0)
|
23
|
-
actionpack (5.2.
|
24
|
-
actionview (= 5.2.
|
25
|
-
activesupport (= 5.2.
|
23
|
+
actionpack (5.2.2)
|
24
|
+
actionview (= 5.2.2)
|
25
|
+
activesupport (= 5.2.2)
|
26
26
|
rack (~> 2.0)
|
27
27
|
rack-test (>= 0.6.3)
|
28
28
|
rails-dom-testing (~> 2.0)
|
29
29
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
30
|
-
actionview (5.2.
|
31
|
-
activesupport (= 5.2.
|
30
|
+
actionview (5.2.2)
|
31
|
+
activesupport (= 5.2.2)
|
32
32
|
builder (~> 3.1)
|
33
33
|
erubi (~> 1.4)
|
34
34
|
rails-dom-testing (~> 2.0)
|
35
35
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
36
|
-
active_attr (0.
|
36
|
+
active_attr (0.12.0)
|
37
37
|
activemodel (>= 3.0.2, < 6.0)
|
38
38
|
activesupport (>= 3.0.2, < 6.0)
|
39
|
-
active_model_serializers (0.10.
|
39
|
+
active_model_serializers (0.10.9)
|
40
40
|
actionpack (>= 4.1, < 6)
|
41
41
|
activemodel (>= 4.1, < 6)
|
42
42
|
case_transform (>= 0.2)
|
43
43
|
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
|
44
|
-
activejob (5.2.
|
45
|
-
activesupport (= 5.2.
|
44
|
+
activejob (5.2.2)
|
45
|
+
activesupport (= 5.2.2)
|
46
46
|
globalid (>= 0.3.6)
|
47
|
-
activemodel (5.2.
|
48
|
-
activesupport (= 5.2.
|
49
|
-
activerecord (5.2.
|
50
|
-
activemodel (= 5.2.
|
51
|
-
activesupport (= 5.2.
|
47
|
+
activemodel (5.2.2)
|
48
|
+
activesupport (= 5.2.2)
|
49
|
+
activerecord (5.2.2)
|
50
|
+
activemodel (= 5.2.2)
|
51
|
+
activesupport (= 5.2.2)
|
52
52
|
arel (>= 9.0)
|
53
|
-
activestorage (5.2.
|
54
|
-
actionpack (= 5.2.
|
55
|
-
activerecord (= 5.2.
|
53
|
+
activestorage (5.2.2)
|
54
|
+
actionpack (= 5.2.2)
|
55
|
+
activerecord (= 5.2.2)
|
56
56
|
marcel (~> 0.3.1)
|
57
|
-
activesupport (5.2.
|
57
|
+
activesupport (5.2.2)
|
58
58
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
59
59
|
i18n (>= 0.7, < 2)
|
60
60
|
minitest (~> 5.1)
|
61
61
|
tzinfo (~> 1.1)
|
62
|
-
addressable (2.
|
62
|
+
addressable (2.6.0)
|
63
63
|
public_suffix (>= 2.0.2, < 4.0)
|
64
64
|
arel (9.0.0)
|
65
65
|
builder (3.2.3)
|
66
66
|
byebug (10.0.2)
|
67
|
-
cancancan (2.
|
67
|
+
cancancan (2.3.0)
|
68
68
|
case_transform (0.2)
|
69
69
|
activesupport
|
70
70
|
coderay (1.1.2)
|
71
|
-
concurrent-ruby (1.
|
71
|
+
concurrent-ruby (1.1.4)
|
72
72
|
crack (0.4.3)
|
73
73
|
safe_yaml (~> 1.0.0)
|
74
74
|
crass (1.0.4)
|
75
75
|
database_cleaner (1.7.0)
|
76
76
|
diff-lcs (1.3)
|
77
77
|
docile (1.3.1)
|
78
|
-
erubi (1.
|
79
|
-
factory_bot (
|
80
|
-
activesupport (>=
|
81
|
-
factory_bot_rails (
|
82
|
-
factory_bot (~>
|
83
|
-
railties (>=
|
84
|
-
faker (1.
|
78
|
+
erubi (1.8.0)
|
79
|
+
factory_bot (5.0.1)
|
80
|
+
activesupport (>= 4.2.0)
|
81
|
+
factory_bot_rails (5.0.1)
|
82
|
+
factory_bot (~> 5.0.0)
|
83
|
+
railties (>= 4.2.0)
|
84
|
+
faker (1.9.3)
|
85
85
|
i18n (>= 0.7)
|
86
|
-
globalid (0.4.
|
86
|
+
globalid (0.4.2)
|
87
87
|
activesupport (>= 4.2.0)
|
88
|
-
hashdiff (0.3.
|
89
|
-
i18n (1.
|
88
|
+
hashdiff (0.3.8)
|
89
|
+
i18n (1.5.3)
|
90
90
|
concurrent-ruby (~> 1.0)
|
91
91
|
json (2.1.0)
|
92
92
|
json_spec (1.1.5)
|
93
93
|
multi_json (~> 1.0)
|
94
94
|
rspec (>= 2.0, < 4.0)
|
95
95
|
jsonapi-renderer (0.2.0)
|
96
|
-
loofah (2.2.
|
96
|
+
loofah (2.2.3)
|
97
97
|
crass (~> 1.0.2)
|
98
98
|
nokogiri (>= 1.5.9)
|
99
|
-
mail (2.7.
|
99
|
+
mail (2.7.1)
|
100
100
|
mini_mime (>= 0.1.1)
|
101
|
-
marcel (0.3.
|
101
|
+
marcel (0.3.3)
|
102
102
|
mimemagic (~> 0.3.2)
|
103
|
-
method_source (0.9.
|
104
|
-
mimemagic (0.3.
|
105
|
-
mini_mime (1.0.
|
106
|
-
mini_portile2 (2.
|
103
|
+
method_source (0.9.2)
|
104
|
+
mimemagic (0.3.3)
|
105
|
+
mini_mime (1.0.1)
|
106
|
+
mini_portile2 (2.4.0)
|
107
107
|
minitest (5.11.3)
|
108
108
|
multi_json (1.13.1)
|
109
109
|
nio4r (2.3.1)
|
110
|
-
nokogiri (1.
|
111
|
-
mini_portile2 (~> 2.
|
112
|
-
pg (1.
|
113
|
-
pry (0.
|
110
|
+
nokogiri (1.10.1)
|
111
|
+
mini_portile2 (~> 2.4.0)
|
112
|
+
pg (1.1.4)
|
113
|
+
pry (0.12.2)
|
114
114
|
coderay (~> 1.1.0)
|
115
115
|
method_source (~> 0.9.0)
|
116
116
|
pry-byebug (3.6.0)
|
117
117
|
byebug (~> 10.0)
|
118
118
|
pry (~> 0.10)
|
119
|
-
public_suffix (3.0.
|
120
|
-
rack (2.0.
|
121
|
-
rack-test (1.
|
119
|
+
public_suffix (3.0.3)
|
120
|
+
rack (2.0.6)
|
121
|
+
rack-test (1.1.0)
|
122
122
|
rack (>= 1.0, < 3)
|
123
|
-
rails (5.2.
|
124
|
-
actioncable (= 5.2.
|
125
|
-
actionmailer (= 5.2.
|
126
|
-
actionpack (= 5.2.
|
127
|
-
actionview (= 5.2.
|
128
|
-
activejob (= 5.2.
|
129
|
-
activemodel (= 5.2.
|
130
|
-
activerecord (= 5.2.
|
131
|
-
activestorage (= 5.2.
|
132
|
-
activesupport (= 5.2.
|
123
|
+
rails (5.2.2)
|
124
|
+
actioncable (= 5.2.2)
|
125
|
+
actionmailer (= 5.2.2)
|
126
|
+
actionpack (= 5.2.2)
|
127
|
+
actionview (= 5.2.2)
|
128
|
+
activejob (= 5.2.2)
|
129
|
+
activemodel (= 5.2.2)
|
130
|
+
activerecord (= 5.2.2)
|
131
|
+
activestorage (= 5.2.2)
|
132
|
+
activesupport (= 5.2.2)
|
133
133
|
bundler (>= 1.3.0)
|
134
|
-
railties (= 5.2.
|
134
|
+
railties (= 5.2.2)
|
135
135
|
sprockets-rails (>= 2.0.0)
|
136
136
|
rails-dom-testing (2.0.3)
|
137
137
|
activesupport (>= 4.2.0)
|
138
138
|
nokogiri (>= 1.6)
|
139
139
|
rails-html-sanitizer (1.0.4)
|
140
140
|
loofah (~> 2.2, >= 2.2.2)
|
141
|
-
railties (5.2.
|
142
|
-
actionpack (= 5.2.
|
143
|
-
activesupport (= 5.2.
|
141
|
+
railties (5.2.2)
|
142
|
+
actionpack (= 5.2.2)
|
143
|
+
activesupport (= 5.2.2)
|
144
144
|
method_source
|
145
145
|
rake (>= 0.8.7)
|
146
|
-
thor (>= 0.
|
146
|
+
thor (>= 0.19.0, < 2.0)
|
147
147
|
rake (10.5.0)
|
148
|
-
rspec (3.
|
149
|
-
rspec-core (~> 3.
|
150
|
-
rspec-expectations (~> 3.
|
151
|
-
rspec-mocks (~> 3.
|
152
|
-
rspec-core (3.
|
153
|
-
rspec-support (~> 3.
|
154
|
-
rspec-expectations (3.
|
148
|
+
rspec (3.8.0)
|
149
|
+
rspec-core (~> 3.8.0)
|
150
|
+
rspec-expectations (~> 3.8.0)
|
151
|
+
rspec-mocks (~> 3.8.0)
|
152
|
+
rspec-core (3.8.0)
|
153
|
+
rspec-support (~> 3.8.0)
|
154
|
+
rspec-expectations (3.8.2)
|
155
155
|
diff-lcs (>= 1.2.0, < 2.0)
|
156
|
-
rspec-support (~> 3.
|
157
|
-
rspec-mocks (3.
|
156
|
+
rspec-support (~> 3.8.0)
|
157
|
+
rspec-mocks (3.8.0)
|
158
158
|
diff-lcs (>= 1.2.0, < 2.0)
|
159
|
-
rspec-support (~> 3.
|
160
|
-
rspec-rails (3.
|
159
|
+
rspec-support (~> 3.8.0)
|
160
|
+
rspec-rails (3.8.2)
|
161
161
|
actionpack (>= 3.0)
|
162
162
|
activesupport (>= 3.0)
|
163
163
|
railties (>= 3.0)
|
164
|
-
rspec-core (~> 3.
|
165
|
-
rspec-expectations (~> 3.
|
166
|
-
rspec-mocks (~> 3.
|
167
|
-
rspec-support (~> 3.
|
168
|
-
rspec-support (3.
|
164
|
+
rspec-core (~> 3.8.0)
|
165
|
+
rspec-expectations (~> 3.8.0)
|
166
|
+
rspec-mocks (~> 3.8.0)
|
167
|
+
rspec-support (~> 3.8.0)
|
168
|
+
rspec-support (3.8.0)
|
169
169
|
safe_yaml (1.0.4)
|
170
170
|
simplecov (0.16.1)
|
171
171
|
docile (~> 1.1)
|
@@ -179,11 +179,11 @@ GEM
|
|
179
179
|
actionpack (>= 4.0)
|
180
180
|
activesupport (>= 4.0)
|
181
181
|
sprockets (>= 3.0.0)
|
182
|
-
thor (0.20.
|
182
|
+
thor (0.20.3)
|
183
183
|
thread_safe (0.3.6)
|
184
184
|
tzinfo (1.2.5)
|
185
185
|
thread_safe (~> 0.1)
|
186
|
-
webmock (3.
|
186
|
+
webmock (3.5.1)
|
187
187
|
addressable (>= 2.3.6)
|
188
188
|
crack (>= 0.3.2)
|
189
189
|
hashdiff
|
@@ -30,9 +30,10 @@ module ActiveRecordApi
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def allowed_params
|
33
|
-
@allowed_params ||= model_klass.column_names.
|
34
|
-
column_name.to_s.gsub('encrypted_', '')
|
35
|
-
|
33
|
+
@allowed_params ||= model_klass.column_names.flat_map do |column_name|
|
34
|
+
col = column_name.to_s.gsub('encrypted_', '').to_sym
|
35
|
+
[col, col => []]
|
36
|
+
end
|
36
37
|
end
|
37
38
|
|
38
39
|
def filtered_params
|
@@ -55,7 +56,9 @@ module ActiveRecordApi
|
|
55
56
|
|
56
57
|
def page_models
|
57
58
|
id_field = model_klass.arel_table[:id]
|
58
|
-
|
59
|
+
updated_models = models.order(:id)
|
60
|
+
updated_models = updated_models.where(id_field.gt previous_id) if previous_id.present?
|
61
|
+
models updated_models
|
59
62
|
@remaining_count = models.count
|
60
63
|
models models.limit(limit)
|
61
64
|
end
|
@@ -77,7 +80,7 @@ module ActiveRecordApi
|
|
77
80
|
end
|
78
81
|
|
79
82
|
def previous_id
|
80
|
-
@previous_id ||= params[:previous_id]
|
83
|
+
@previous_id ||= params[:previous_id]
|
81
84
|
end
|
82
85
|
end
|
83
86
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_api-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Full Measure Education
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|