firetail 0.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/pull_request_template.md +11 -0
- data/.github/workflows/main.yml +40 -0
- data/.gitignore +28 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +74 -0
- data/LICENSE +165 -0
- data/LICENSE.txt +165 -21
- data/README.md +24 -10
- data/examples/rails/.gitattributes +8 -0
- data/examples/rails/.gitignore +31 -0
- data/examples/rails/.rspec +1 -0
- data/examples/rails/.ruby-version +1 -0
- data/examples/rails/Gemfile +44 -0
- data/examples/rails/Gemfile.lock +240 -0
- data/examples/rails/README.md +24 -0
- data/examples/rails/Rakefile +6 -0
- data/examples/rails/app/channels/application_cable/channel.rb +4 -0
- data/examples/rails/app/channels/application_cable/connection.rb +4 -0
- data/examples/rails/app/controllers/application_controller.rb +2 -0
- data/examples/rails/app/controllers/comments_controller.rb +52 -0
- data/examples/rails/app/controllers/concerns/.keep +0 -0
- data/examples/rails/app/controllers/posts_controller.rb +51 -0
- data/examples/rails/app/jobs/application_job.rb +7 -0
- data/examples/rails/app/mailers/application_mailer.rb +4 -0
- data/examples/rails/app/models/application_record.rb +3 -0
- data/examples/rails/app/models/comment.rb +4 -0
- data/examples/rails/app/models/concerns/.keep +0 -0
- data/examples/rails/app/models/post.rb +5 -0
- data/examples/rails/app/views/layouts/mailer.html.erb +13 -0
- data/examples/rails/app/views/layouts/mailer.text.erb +1 -0
- data/examples/rails/bin/bundle +114 -0
- data/examples/rails/bin/rails +5 -0
- data/examples/rails/bin/rake +5 -0
- data/examples/rails/bin/setup +33 -0
- data/examples/rails/bin/spring +14 -0
- data/examples/rails/config/application.rb +41 -0
- data/examples/rails/config/boot.rb +4 -0
- data/examples/rails/config/cable.yml +10 -0
- data/examples/rails/config/credentials.yml.enc +1 -0
- data/examples/rails/config/database.yml +25 -0
- data/examples/rails/config/environment.rb +5 -0
- data/examples/rails/config/environments/development.rb +66 -0
- data/examples/rails/config/environments/production.rb +113 -0
- data/examples/rails/config/environments/test.rb +60 -0
- data/examples/rails/config/firetail.yml +2 -0
- data/examples/rails/config/initializers/application_controller_renderer.rb +8 -0
- data/examples/rails/config/initializers/backtrace_silencers.rb +8 -0
- data/examples/rails/config/initializers/cors.rb +16 -0
- data/examples/rails/config/initializers/filter_parameter_logging.rb +6 -0
- data/examples/rails/config/initializers/inflections.rb +16 -0
- data/examples/rails/config/initializers/mime_types.rb +4 -0
- data/examples/rails/config/initializers/wrap_parameters.rb +14 -0
- data/examples/rails/config/locales/en.yml +33 -0
- data/examples/rails/config/puma.rb +43 -0
- data/examples/rails/config/routes.rb +6 -0
- data/examples/rails/config/schema.json +431 -0
- data/examples/rails/config/spring.rb +6 -0
- data/examples/rails/config/storage.yml +34 -0
- data/examples/rails/config.ru +6 -0
- data/examples/rails/db/migrate/20230730163722_create_posts.rb +8 -0
- data/examples/rails/db/migrate/20230730163741_create_comments.rb +9 -0
- data/examples/rails/db/migrate/20230730164121_add_fields_to_post.rb +6 -0
- data/examples/rails/db/migrate/20230730164214_add_fields_to_comments.rb +6 -0
- data/examples/rails/db/schema.rb +30 -0
- data/examples/rails/db/seeds.rb +7 -0
- data/examples/rails/lib/tasks/.keep +0 -0
- data/examples/rails/log/.keep +0 -0
- data/examples/rails/public/robots.txt +1 -0
- data/examples/rails/spec/models/comment_spec.rb +5 -0
- data/examples/rails/spec/models/post_spec.rb +5 -0
- data/examples/rails/spec/rails_helper.rb +63 -0
- data/examples/rails/spec/requests/comments_spec.rb +127 -0
- data/examples/rails/spec/requests/posts_spec.rb +127 -0
- data/examples/rails/spec/routing/comments_routing_spec.rb +30 -0
- data/examples/rails/spec/routing/posts_routing_spec.rb +30 -0
- data/examples/rails/spec/spec_helper.rb +94 -0
- data/examples/rails/storage/.keep +0 -0
- data/examples/rails/test/channels/application_cable/connection_test.rb +11 -0
- data/examples/rails/test/controllers/.keep +0 -0
- data/examples/rails/test/fixtures/files/.keep +0 -0
- data/examples/rails/test/integration/.keep +0 -0
- data/examples/rails/test/mailers/.keep +0 -0
- data/examples/rails/test/models/.keep +0 -0
- data/examples/rails/test/test_helper.rb +13 -0
- data/examples/rails/tmp/.keep +0 -0
- data/examples/rails/tmp/pids/.keep +0 -0
- data/examples/rails/vendor/.keep +0 -0
- data/firetail.gemspec +8 -1
- data/lib/backend.rb +34 -0
- data/lib/background_tasks.rb +43 -0
- data/lib/case_sensitive_headers.rb +29 -0
- data/lib/firetail/version.rb +1 -1
- data/lib/firetail.rb +264 -1
- data/lib/generators/firetail/install/templates/README +15 -0
- data/lib/generators/firetail/install/templates/firetail.yml +2 -0
- data/lib/generators/firetail/install/templates/schema.json +108 -0
- data/lib/generators/firetail/install_generator.rb +26 -0
- data/lib/railtie.rb +29 -0
- metadata +169 -8
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.0.0",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "api-test",
|
|
5
|
+
"version": "1.0"
|
|
6
|
+
},
|
|
7
|
+
"servers": [
|
|
8
|
+
{
|
|
9
|
+
"url": "http://localhost:3000",
|
|
10
|
+
"description": "dev"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"paths": {
|
|
14
|
+
"/posts": {
|
|
15
|
+
"get": {
|
|
16
|
+
"summary": "Returns all posts",
|
|
17
|
+
"operationId": "findPosts",
|
|
18
|
+
"responses": {
|
|
19
|
+
"200": {
|
|
20
|
+
"description": "correct response",
|
|
21
|
+
"content": {
|
|
22
|
+
"application/json": {
|
|
23
|
+
"schema": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"properties": {
|
|
26
|
+
"title": {
|
|
27
|
+
"type": "string"
|
|
28
|
+
},
|
|
29
|
+
"content": {
|
|
30
|
+
"type": "string"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"post": {
|
|
40
|
+
"requestBody": {
|
|
41
|
+
"content": {
|
|
42
|
+
"application/json": {
|
|
43
|
+
"schema": {
|
|
44
|
+
"$ref": "#/components/schemas/NewPost"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"responses": {
|
|
50
|
+
"200": {
|
|
51
|
+
"description": "correct response",
|
|
52
|
+
"content": {
|
|
53
|
+
"application/json": {
|
|
54
|
+
"schema": {
|
|
55
|
+
"$ref": "#/components/schemas/Post"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"/posts/{id}" : {
|
|
64
|
+
"get": {
|
|
65
|
+
"summary": "Returns a post by ID",
|
|
66
|
+
"description": "Returns a post based on a single ID",
|
|
67
|
+
"operationId": "findPostByID",
|
|
68
|
+
"parameters": [
|
|
69
|
+
{
|
|
70
|
+
"name": "id",
|
|
71
|
+
"in": "path",
|
|
72
|
+
"description": "ID of post to fetch",
|
|
73
|
+
"required": true,
|
|
74
|
+
"schema": {
|
|
75
|
+
"type": "integer",
|
|
76
|
+
"format": "int64"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"responses": {
|
|
81
|
+
"200": {
|
|
82
|
+
"description": "post response",
|
|
83
|
+
"content": {
|
|
84
|
+
"application/json": {
|
|
85
|
+
"schema": {
|
|
86
|
+
"$ref": "#/components/schemas/Post"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"default": {
|
|
92
|
+
"description": "unexpected error",
|
|
93
|
+
"content": {
|
|
94
|
+
"application/json": {
|
|
95
|
+
"schema": {
|
|
96
|
+
"$ref": "#/components/schemas/Error"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"delete": {
|
|
104
|
+
"summary": "Deletes a post by ID",
|
|
105
|
+
"description": "deletes a single post based on the ID supplied",
|
|
106
|
+
"operationId": "deletePost",
|
|
107
|
+
"parameters": [
|
|
108
|
+
{
|
|
109
|
+
"name": "id",
|
|
110
|
+
"in": "path",
|
|
111
|
+
"description": "ID of post to delete",
|
|
112
|
+
"required": true,
|
|
113
|
+
"schema": {
|
|
114
|
+
"type": "integer",
|
|
115
|
+
"format": "int64"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"responses": {
|
|
120
|
+
"204": {
|
|
121
|
+
"description": "post deleted"
|
|
122
|
+
},
|
|
123
|
+
"default": {
|
|
124
|
+
"description": "unexpected error",
|
|
125
|
+
"content": {
|
|
126
|
+
"application/json": {
|
|
127
|
+
"schema": {
|
|
128
|
+
"$ref": "#/components/schemas/Error"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"/posts/{postId}/comments" : {
|
|
137
|
+
"get": {
|
|
138
|
+
"summary": "Returns a list of comments for the post",
|
|
139
|
+
"description": "Returns comments for a post",
|
|
140
|
+
"operationId": "findCommentsByPostId",
|
|
141
|
+
"parameters": [
|
|
142
|
+
{
|
|
143
|
+
"name": "postId",
|
|
144
|
+
"in": "path",
|
|
145
|
+
"description": "comments by postId",
|
|
146
|
+
"required": true,
|
|
147
|
+
"schema": {
|
|
148
|
+
"type": "integer",
|
|
149
|
+
"format": "int64"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"responses": {
|
|
154
|
+
"200": {
|
|
155
|
+
"description": "comments response",
|
|
156
|
+
"content": {
|
|
157
|
+
"application/json": {
|
|
158
|
+
"schema": {
|
|
159
|
+
"type": "array",
|
|
160
|
+
"nullable": true,
|
|
161
|
+
"items": {
|
|
162
|
+
"$ref": "#/components/schemas/NamedComment"
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"default": {
|
|
169
|
+
"description": "unexpected error",
|
|
170
|
+
"content": {
|
|
171
|
+
"application/json": {
|
|
172
|
+
"schema": {
|
|
173
|
+
"$ref": "#/components/schemas/Error"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"post": {
|
|
181
|
+
"requestBody": {
|
|
182
|
+
"content": {
|
|
183
|
+
"application/json": {
|
|
184
|
+
"schema": {
|
|
185
|
+
"$ref": "#/components/schemas/NewComment"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"responses": {
|
|
191
|
+
"200": {
|
|
192
|
+
"description": "correct response",
|
|
193
|
+
"content": {
|
|
194
|
+
"application/json": {
|
|
195
|
+
"schema": {
|
|
196
|
+
"$ref": "#/components/schemas/Comment"
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"security": ["MySecurityMechanism"]
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"/posts/{postId}/comments/{id}" : {
|
|
206
|
+
"get": {
|
|
207
|
+
"summary": "Returns a list of comments for the post",
|
|
208
|
+
"description": "Returns comments for a post",
|
|
209
|
+
"operationId": "findCommentsByPostId",
|
|
210
|
+
"parameters": [
|
|
211
|
+
{
|
|
212
|
+
"name": "postId",
|
|
213
|
+
"in": "path",
|
|
214
|
+
"description": "comments by postId",
|
|
215
|
+
"required": true,
|
|
216
|
+
"schema": {
|
|
217
|
+
"type": "integer",
|
|
218
|
+
"format": "int64"
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"name": "id",
|
|
223
|
+
"in": "path",
|
|
224
|
+
"description": "comments by id",
|
|
225
|
+
"required": true,
|
|
226
|
+
"schema": {
|
|
227
|
+
"type": "integer",
|
|
228
|
+
"format": "int64"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
],
|
|
232
|
+
"responses": {
|
|
233
|
+
"200": {
|
|
234
|
+
"description": "comments response",
|
|
235
|
+
"content": {
|
|
236
|
+
"application/json": {
|
|
237
|
+
"schema": {
|
|
238
|
+
"type": "array",
|
|
239
|
+
"nullable": true,
|
|
240
|
+
"items": {
|
|
241
|
+
"$ref": "#/components/schemas/NamedComment"
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"default": {
|
|
248
|
+
"description": "unexpected error",
|
|
249
|
+
"content": {
|
|
250
|
+
"application/json": {
|
|
251
|
+
"schema": {
|
|
252
|
+
"$ref": "#/components/schemas/Error"
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"delete": {
|
|
260
|
+
"summary": "Deletes a comment of a post by ID",
|
|
261
|
+
"description": "deletes a single post based on the ID supplied",
|
|
262
|
+
"operationId": "deletePost",
|
|
263
|
+
"parameters": [
|
|
264
|
+
{
|
|
265
|
+
"name": "postId",
|
|
266
|
+
"in": "path",
|
|
267
|
+
"description": "ID of post",
|
|
268
|
+
"required": true,
|
|
269
|
+
"schema": {
|
|
270
|
+
"type": "integer",
|
|
271
|
+
"format": "int64"
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"name": "id",
|
|
276
|
+
"in": "path",
|
|
277
|
+
"description": "ID of comment to delete",
|
|
278
|
+
"required": true,
|
|
279
|
+
"schema": {
|
|
280
|
+
"type": "integer",
|
|
281
|
+
"format": "int64"
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
"responses": {
|
|
286
|
+
"204": {
|
|
287
|
+
"description": "comment deleted"
|
|
288
|
+
},
|
|
289
|
+
"default": {
|
|
290
|
+
"description": "unexpected error",
|
|
291
|
+
"content": {
|
|
292
|
+
"application/json": {
|
|
293
|
+
"schema": {
|
|
294
|
+
"$ref": "#/components/schemas/Error"
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"components": {
|
|
304
|
+
"securitySchemes": {
|
|
305
|
+
"MySecurityMechanism": {
|
|
306
|
+
"type": "http",
|
|
307
|
+
"scheme": "bearer",
|
|
308
|
+
"bearerFormat": "JWT"
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"schemas": {
|
|
312
|
+
"NewPost": {
|
|
313
|
+
"type": "object",
|
|
314
|
+
"required": [
|
|
315
|
+
"title",
|
|
316
|
+
"content"
|
|
317
|
+
],
|
|
318
|
+
"properties": {
|
|
319
|
+
"title": {
|
|
320
|
+
"type": "string",
|
|
321
|
+
"description": "Title of the post"
|
|
322
|
+
},
|
|
323
|
+
"content": {
|
|
324
|
+
"type": "string",
|
|
325
|
+
"description": "Content of the post"
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
"Comment": {
|
|
330
|
+
"allOf": [
|
|
331
|
+
{
|
|
332
|
+
"$ref": "#/components/schemas/Comment"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"required": [
|
|
336
|
+
"id"
|
|
337
|
+
],
|
|
338
|
+
"properties": {
|
|
339
|
+
"id": {
|
|
340
|
+
"type": "integer",
|
|
341
|
+
"format": "int64",
|
|
342
|
+
"description": "Unique id of the comment"
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
]
|
|
347
|
+
},
|
|
348
|
+
"NamedPost": {
|
|
349
|
+
"required": [
|
|
350
|
+
"id",
|
|
351
|
+
"title"
|
|
352
|
+
],
|
|
353
|
+
"additionalProperties": false,
|
|
354
|
+
"properties": {
|
|
355
|
+
"id": {
|
|
356
|
+
"type": "integer",
|
|
357
|
+
"format": "int64",
|
|
358
|
+
"description": "Unique id of the post"
|
|
359
|
+
},
|
|
360
|
+
"title": {
|
|
361
|
+
"type": "string",
|
|
362
|
+
"description": "Title of the post"
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
"NamedComment": {
|
|
367
|
+
"required": [
|
|
368
|
+
"message"
|
|
369
|
+
],
|
|
370
|
+
"additionalProperties": false,
|
|
371
|
+
"properties": {
|
|
372
|
+
"postId": {
|
|
373
|
+
"type": "integer",
|
|
374
|
+
"format": "int64",
|
|
375
|
+
"description": "Unique id of the post"
|
|
376
|
+
},
|
|
377
|
+
"message": {
|
|
378
|
+
"type": "string",
|
|
379
|
+
"description": "comment message"
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
"NewPost": {
|
|
384
|
+
"type": "object",
|
|
385
|
+
"required": [
|
|
386
|
+
"title",
|
|
387
|
+
"content"
|
|
388
|
+
],
|
|
389
|
+
"properties": {
|
|
390
|
+
"title": {
|
|
391
|
+
"type": "string",
|
|
392
|
+
"description": "Title of the post"
|
|
393
|
+
},
|
|
394
|
+
"content": {
|
|
395
|
+
"type": "string",
|
|
396
|
+
"description": "Content of the post"
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
"NewComment": {
|
|
401
|
+
"type": "object",
|
|
402
|
+
"required": [
|
|
403
|
+
"message"
|
|
404
|
+
],
|
|
405
|
+
"properties": {
|
|
406
|
+
"message": {
|
|
407
|
+
"type": "string",
|
|
408
|
+
"description": "Comment message"
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
"Error": {
|
|
413
|
+
"required": [
|
|
414
|
+
"code",
|
|
415
|
+
"message"
|
|
416
|
+
],
|
|
417
|
+
"properties": {
|
|
418
|
+
"code": {
|
|
419
|
+
"type": "integer",
|
|
420
|
+
"format": "int32",
|
|
421
|
+
"description": "Error code"
|
|
422
|
+
},
|
|
423
|
+
"message": {
|
|
424
|
+
"type": "string",
|
|
425
|
+
"description": "Error message"
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
test:
|
|
2
|
+
service: Disk
|
|
3
|
+
root: <%= Rails.root.join("tmp/storage") %>
|
|
4
|
+
|
|
5
|
+
local:
|
|
6
|
+
service: Disk
|
|
7
|
+
root: <%= Rails.root.join("storage") %>
|
|
8
|
+
|
|
9
|
+
# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
|
|
10
|
+
# amazon:
|
|
11
|
+
# service: S3
|
|
12
|
+
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
|
|
13
|
+
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
|
|
14
|
+
# region: us-east-1
|
|
15
|
+
# bucket: your_own_bucket
|
|
16
|
+
|
|
17
|
+
# Remember not to checkin your GCS keyfile to a repository
|
|
18
|
+
# google:
|
|
19
|
+
# service: GCS
|
|
20
|
+
# project: your_project
|
|
21
|
+
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
|
|
22
|
+
# bucket: your_own_bucket
|
|
23
|
+
|
|
24
|
+
# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
|
|
25
|
+
# microsoft:
|
|
26
|
+
# service: AzureStorage
|
|
27
|
+
# storage_account_name: your_account_name
|
|
28
|
+
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
|
|
29
|
+
# container: your_container_name
|
|
30
|
+
|
|
31
|
+
# mirror:
|
|
32
|
+
# service: Mirror
|
|
33
|
+
# primary: local
|
|
34
|
+
# mirrors: [ amazon, google, microsoft ]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# This file is auto-generated from the current state of the database. Instead
|
|
2
|
+
# of editing this file, please use the migrations feature of Active Record to
|
|
3
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
|
4
|
+
#
|
|
5
|
+
# This file is the source Rails uses to define your schema when running `bin/rails
|
|
6
|
+
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
|
7
|
+
# be faster and is potentially less error prone than running all of your
|
|
8
|
+
# migrations from scratch. Old migrations may fail to apply correctly if those
|
|
9
|
+
# migrations use external dependencies or application code.
|
|
10
|
+
#
|
|
11
|
+
# It's strongly recommended that you check this file into your version control system.
|
|
12
|
+
|
|
13
|
+
ActiveRecord::Schema.define(version: 2023_07_30_164214) do
|
|
14
|
+
|
|
15
|
+
create_table "comments", force: :cascade do |t|
|
|
16
|
+
t.text "message"
|
|
17
|
+
t.datetime "created_at", precision: 6, null: false
|
|
18
|
+
t.datetime "updated_at", precision: 6, null: false
|
|
19
|
+
t.text "comment"
|
|
20
|
+
t.integer "post_id"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
create_table "posts", force: :cascade do |t|
|
|
24
|
+
t.datetime "created_at", precision: 6, null: false
|
|
25
|
+
t.datetime "updated_at", precision: 6, null: false
|
|
26
|
+
t.string "title"
|
|
27
|
+
t.text "content"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
end
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# This file should contain all the record creation needed to seed the database with its default values.
|
|
2
|
+
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
|
|
3
|
+
#
|
|
4
|
+
# Examples:
|
|
5
|
+
#
|
|
6
|
+
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
|
|
7
|
+
# Character.create(name: 'Luke', movie: movies.first)
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
|
2
|
+
require 'spec_helper'
|
|
3
|
+
ENV['RAILS_ENV'] ||= 'test'
|
|
4
|
+
require_relative '../config/environment'
|
|
5
|
+
# Prevent database truncation if the environment is production
|
|
6
|
+
abort("The Rails environment is running in production mode!") if Rails.env.production?
|
|
7
|
+
require 'rspec/rails'
|
|
8
|
+
# Add additional requires below this line. Rails is not loaded until this point!
|
|
9
|
+
|
|
10
|
+
# Requires supporting ruby files with custom matchers and macros, etc, in
|
|
11
|
+
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
|
12
|
+
# run as spec files by default. This means that files in spec/support that end
|
|
13
|
+
# in _spec.rb will both be required and run as specs, causing the specs to be
|
|
14
|
+
# run twice. It is recommended that you do not name files matching this glob to
|
|
15
|
+
# end with _spec.rb. You can configure this pattern with the --pattern
|
|
16
|
+
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
|
17
|
+
#
|
|
18
|
+
# The following line is provided for convenience purposes. It has the downside
|
|
19
|
+
# of increasing the boot-up time by auto-requiring all files in the support
|
|
20
|
+
# directory. Alternatively, in the individual `*_spec.rb` files, manually
|
|
21
|
+
# require only the support files necessary.
|
|
22
|
+
#
|
|
23
|
+
# Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each { |f| require f }
|
|
24
|
+
|
|
25
|
+
# Checks for pending migrations and applies them before tests are run.
|
|
26
|
+
# If you are not using ActiveRecord, you can remove these lines.
|
|
27
|
+
begin
|
|
28
|
+
ActiveRecord::Migration.maintain_test_schema!
|
|
29
|
+
rescue ActiveRecord::PendingMigrationError => e
|
|
30
|
+
abort e.to_s.strip
|
|
31
|
+
end
|
|
32
|
+
RSpec.configure do |config|
|
|
33
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
|
34
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
|
35
|
+
|
|
36
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
|
37
|
+
# examples within a transaction, remove the following line or assign false
|
|
38
|
+
# instead of true.
|
|
39
|
+
config.use_transactional_fixtures = true
|
|
40
|
+
|
|
41
|
+
# You can uncomment this line to turn off ActiveRecord support entirely.
|
|
42
|
+
# config.use_active_record = false
|
|
43
|
+
|
|
44
|
+
# RSpec Rails can automatically mix in different behaviours to your tests
|
|
45
|
+
# based on their file location, for example enabling you to call `get` and
|
|
46
|
+
# `post` in specs under `spec/controllers`.
|
|
47
|
+
#
|
|
48
|
+
# You can disable this behaviour by removing the line below, and instead
|
|
49
|
+
# explicitly tag your specs with their type, e.g.:
|
|
50
|
+
#
|
|
51
|
+
# RSpec.describe UsersController, type: :controller do
|
|
52
|
+
# # ...
|
|
53
|
+
# end
|
|
54
|
+
#
|
|
55
|
+
# The different available types are documented in the features, such as in
|
|
56
|
+
# https://rspec.info/features/6-0/rspec-rails
|
|
57
|
+
config.infer_spec_type_from_file_location!
|
|
58
|
+
|
|
59
|
+
# Filter lines from Rails gems in backtraces.
|
|
60
|
+
config.filter_rails_from_backtrace!
|
|
61
|
+
# arbitrary gems may also be filtered via:
|
|
62
|
+
# config.filter_gems_from_backtrace("gem name")
|
|
63
|
+
end
|