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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96f1e943d71e91ceb6caa7cba651a86e3f93e70c5ac1d2e27bd0498fd9d2a853
4
- data.tar.gz: fff3f3e4acf8c71edff06491824431a1c71ccb660355aea8b79eb39c3a824f58
3
+ metadata.gz: c886deb2e5f957a2f6683c8766d75b9ee0b6c3e6b9e85a7a221c3a18ea2f1ef7
4
+ data.tar.gz: ee3f4edb0b2dadc8e7593ef8f19c5b226cef019488cd27b481957929a0cca290
5
5
  SHA512:
6
- metadata.gz: 96e451239ab9a7ae56c792d0901a1c22128983273dc1a827a2f26b236b573a10e38565ebec7a7510161b1b1e108f7e99b8c9cedf22bb59995422a88febd721bd
7
- data.tar.gz: 4778a6f4796e2d59f244a2af8982b3512136276c7d4b829990fc13d74e5b89f08631a2f35f97247324a4c0d7c0297cb954943f259d6910611956db83068c4939
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
- "user": "users.md#user-model",
81
+ "user_id": "integer",
82
+ "created_at": "datetime",
83
+ "updated_at": "datetime"
82
84
  }
83
85
  ```
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- documentation-zero (0.0.7)
4
+ documentation-zero (0.0.10)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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 ```- [Posts](sections/posts.md)``` to API endpoints section.
27
+ Add `- [Posts](sections/posts.md)` to API endpoints section.
28
28
 
29
29
  ## Development
30
30
 
@@ -1,3 +1,3 @@
1
1
  module DocumentationZero
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.10"
3
3
  end
@@ -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.name %>": "string",
80
+ "<%= attribute.column_name %>": "string",
81
81
  <% elsif attribute.reference? -%>
82
- "<%= attribute.name %>": "<%= attribute.name.pluralize %>.md#<%= attribute.name.dasherize %>-model",
82
+ "<%= attribute.column_name %>": "integer",
83
83
  <% elsif !attribute.virtual? -%>
84
- "<%= attribute.name %>": "<%= attribute.type %>",
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
  ```
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: documentation-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon