lib/generators/rider_kick/templates/db/structures/example.yaml.tt in rider-kick-0.0.3 vs lib/generators/rider_kick/templates/db/structures/example.yaml.tt in rider-kick-0.0.4
- old
+ new
@@ -3,10 +3,13 @@
actor: <%= @actor %>
fields:
<% @model_class.columns.each do |field| -%>
- <%= field.name.to_s %>
<% end -%>
+<% @uploaders.each do |field| -%>
+ - <%= field %>
+<% end -%>
uploaders:
<% @uploaders.each do |field| -%>
- <%= field %>
<% end -%>
search_able:
@@ -14,44 +17,39 @@
<% if ['title', 'name'].include?(field) -%>
- <%= field %>
<% end -%>
<% end -%>
controllers:
- route_scope: <%= @route_scope_path %>
list_fields:
<% @fields.each do |field| -%>
- <%= field %>
<% end -%>
show_fields:
<% @model_class.columns.each do |field| -%>
- <%= field.name.to_s %>
<% end -%>
- form_fields:
-<% (@fields + @uploaders).each do |field| -%>
+<% @uploaders.each do |field| -%>
- <%= field %>
<% end -%>
+ form_fields:
+<% (@fields).each do |field| -%>
+ - name: <%= field %>
+ type: string
+<% end -%>
+<% (@uploaders).each do |field| -%>
+ - name: <%= field %>
+ type: file
+<% end -%>
domains:
action_list:
- endpoint:
- is_auth: true
- is_skip: false
- parameters:
use_case:
contract:
action_fetch_by_id:
- endpoint:
- is_auth: true
- is_skip: false
- parameters:
use_case:
contract:
- required(:id).filled(:string)
action_create:
- endpoint:
- is_auth: true
- is_skip: false
- parameters:
use_case:
contract:
<% (@fields + @uploaders).each do |field| -%>
<% column_type = get_column_type(field) -%>
<% dry_type = @type_mapping[column_type.to_s] || ':string' -%>
@@ -60,14 +58,10 @@
<% else -%>
- required(:<%= field %>).filled(<%= dry_type %>)
<% end -%>
<% end -%>
action_update:
- endpoint:
- is_auth: true
- is_skip: false
- parameters:
use_case:
contract:
- required(:id).filled(:string)
<% (@fields + @uploaders).each do |field| -%>
<% column_type = get_column_type(field) -%>
@@ -77,13 +71,9 @@
<% else -%>
- optional(:<%= field %>).maybe(<%= dry_type %>)
<% end -%>
<% end -%>
action_destroy:
- endpoint:
- is_auth: true
- is_skip: false
- parameters:
use_case:
contract:
- required(:id).filled(:string)
entity:
skipped_fields:
\ No newline at end of file