documentation-zero 0.0.7 → 0.0.10
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/.documentation_api/sections/posts.md +3 -1
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/documentation_zero/version.rb +1 -1
- data/lib/generators/documentation/scaffold/scaffold_generator.rb +3 -0
- data/lib/generators/documentation/scaffold/templates/resource.md.tt +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c886deb2e5f957a2f6683c8766d75b9ee0b6c3e6b9e85a7a221c3a18ea2f1ef7
|
4
|
+
data.tar.gz: ee3f4edb0b2dadc8e7593ef8f19c5b226cef019488cd27b481957929a0cca290
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c467fd091ff67eafcc270466afc4ed79f86622a2d2cee4814c3ff0e4220a3c9bf27bb2c2e9565be74f0cc4c6ca1da3488d1b36ffadb997145ce3aa0824ba1f67
|
7
|
+
data.tar.gz: 12e7fe2eb9d5efa5f1d16d285c8d4c7894c67158168f5cf89ab4d3ccf72ec0cad502002f1a8980fcf28e36e4024a36f1aadf9718a88602d3c6e86e47f40689c8
|
@@ -78,6 +78,8 @@ This endpoint will return `204 No Content` if successful. No parameters are requ
|
|
78
78
|
"title": "string",
|
79
79
|
"content": "string",
|
80
80
|
"published": "boolean",
|
81
|
-
"
|
81
|
+
"user_id": "integer",
|
82
|
+
"created_at": "datetime",
|
83
|
+
"updated_at": "datetime"
|
82
84
|
}
|
83
85
|
```
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -24,7 +24,7 @@ rails generate documentation:readme
|
|
24
24
|
rails generate documentation:scaffold posts title:string body:text published:boolean user:references
|
25
25
|
```
|
26
26
|
|
27
|
-
Add
|
27
|
+
Add `- [Posts](sections/posts.md)` to API endpoints section.
|
28
28
|
|
29
29
|
## Development
|
30
30
|
|
@@ -2,6 +2,9 @@ module Documentation
|
|
2
2
|
module Generators
|
3
3
|
class ScaffoldGenerator < Rails::Generators::NamedBase
|
4
4
|
argument :attributes, type: :array, default: [], banner: "field:type field:type"
|
5
|
+
|
6
|
+
class_option :timestamps, type: :boolean, default: true
|
7
|
+
|
5
8
|
source_root File.expand_path("templates", __dir__)
|
6
9
|
|
7
10
|
def copy_files
|
@@ -77,12 +77,16 @@ This endpoint will return `204 No Content` if successful. No parameters are requ
|
|
77
77
|
<% if attribute.password_digest? -%>
|
78
78
|
"password_digest": "string",
|
79
79
|
<% elsif attribute.token? -%>
|
80
|
-
"<%= attribute.
|
80
|
+
"<%= attribute.column_name %>": "string",
|
81
81
|
<% elsif attribute.reference? -%>
|
82
|
-
"<%= attribute.
|
82
|
+
"<%= attribute.column_name %>": "integer",
|
83
83
|
<% elsif !attribute.virtual? -%>
|
84
|
-
"<%= attribute.
|
84
|
+
"<%= attribute.column_name %>": "<%= attribute.type %>",
|
85
85
|
<% end -%>
|
86
86
|
<% end -%>
|
87
|
+
<% if options.timestamps? -%>
|
88
|
+
"created_at": "datetime",
|
89
|
+
"updated_at": "datetime"
|
90
|
+
<% end -%>
|
87
91
|
}
|
88
92
|
```
|