bullet_train-super_scaffolding 1.3.21 → 1.3.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/account/scaffolding/completely_concrete/tangible_things_controller.rb +6 -0
- data/app/controllers/api/v1/scaffolding/completely_concrete/tangible_things_controller.rb +10 -0
- data/app/models/scaffolding/completely_concrete/tangible_thing.rb +3 -0
- data/app/views/account/scaffolding/completely_concrete/tangible_things/_form.html.erb +2 -0
- data/app/views/account/scaffolding/completely_concrete/tangible_things/show.html.erb +1 -0
- data/config/locales/en/scaffolding/completely_concrete/tangible_things.en.yml +5 -0
- data/lib/bullet_train/super_scaffolding/version.rb +1 -1
- data/lib/scaffolding/attribute.rb +2 -2
- data/lib/scaffolding/transformer.rb +3 -3
- 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: bbcde213b30f69abe18110f85a59c1e5b19d7f4bdfcb31cf587fbe28918c382e
|
4
|
+
data.tar.gz: c64d0d9b5e650e198fc25694ad24e53d914e3e3fee3954d87bcbe3e384989def
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 981b5c308a58f8ad114892237c98d9ef1c4e93e59126ddc55eba47b4cc14aaef974f41a46f3932d64736a09dd3c36d499b31160a9c5c023901a79f13e4aafe72
|
7
|
+
data.tar.gz: e66e54444da188afcfbc8756d16bfb17e9f0178056cd57adf85dabeb5699b22489f9a9ef6f9a02c60086e17bcdd29889fc0d9c2f4ab91beeaac0e6d716bb5e0d
|
@@ -15,10 +15,16 @@ class Account::Scaffolding::CompletelyConcrete::TangibleThingsController < Accou
|
|
15
15
|
|
16
16
|
# GET /account/scaffolding/absolutely_abstract/creative_concepts/:absolutely_abstract_creative_concept_id/completely_concrete/tangible_things/new
|
17
17
|
def new
|
18
|
+
# 🚅 skip this section when scaffolding.
|
19
|
+
@tangible_thing.address_value = Address.new
|
20
|
+
# 🚅 stop any skipping we're doing now.
|
18
21
|
end
|
19
22
|
|
20
23
|
# GET /account/scaffolding/completely_concrete/tangible_things/:id/edit
|
21
24
|
def edit
|
25
|
+
# 🚅 skip this section when scaffolding.
|
26
|
+
@tangible_thing.address_value ||= Address.new
|
27
|
+
# 🚅 stop any skipping we're doing now.
|
22
28
|
end
|
23
29
|
|
24
30
|
# POST /account/scaffolding/absolutely_abstract/creative_concepts/:absolutely_abstract_creative_concept_id/completely_concrete/tangible_things
|
@@ -67,6 +67,16 @@ if defined?(Api::V1::ApplicationController)
|
|
67
67
|
# 🚅 skip this section when scaffolding.
|
68
68
|
multiple_button_values: [],
|
69
69
|
multiple_option_values: [],
|
70
|
+
address_value_attributes: [
|
71
|
+
:id,
|
72
|
+
:address_one,
|
73
|
+
:address_two,
|
74
|
+
:city,
|
75
|
+
:region_id,
|
76
|
+
:region_name,
|
77
|
+
:country_id,
|
78
|
+
:postal_code
|
79
|
+
],
|
70
80
|
multiple_super_select_values: []
|
71
81
|
# 🚅 stop any skipping we're doing now.
|
72
82
|
# 🚅 super scaffolding will insert new arrays above this line.
|
@@ -13,7 +13,10 @@ class Scaffolding::CompletelyConcrete::TangibleThing < ApplicationRecord
|
|
13
13
|
# 🚅 add oauth providers above.
|
14
14
|
|
15
15
|
has_one_attached :file_field_value
|
16
|
+
|
16
17
|
has_one :team, through: :absolutely_abstract_creative_concept
|
18
|
+
has_one :address_value, class_name: "Address", as: :addressable
|
19
|
+
accepts_nested_attributes_for :address_value
|
17
20
|
# 🚅 add has_one associations above.
|
18
21
|
|
19
22
|
# 🚅 add scopes above.
|
@@ -49,6 +49,8 @@
|
|
49
49
|
<%= render 'shared/fields/super_select', method: :multiple_super_select_values, other_options: {search: true}, html_options: {multiple: true} %>
|
50
50
|
</div>
|
51
51
|
</div>
|
52
|
+
|
53
|
+
<%= render 'shared/fields/address_field', method: :address_value %>
|
52
54
|
|
53
55
|
<%= render 'shared/fields/text_area', method: :text_area_value %>
|
54
56
|
<%= render 'shared/fields/trix_editor', method: :action_text_value %>
|
@@ -23,6 +23,7 @@
|
|
23
23
|
<%= render 'shared/attributes/email', attribute: :email_field_value %>
|
24
24
|
<%= render 'shared/attributes/text', attribute: :password_field_value %>
|
25
25
|
<%= render 'shared/attributes/phone_number', attribute: :phone_field_value %>
|
26
|
+
<%= render 'shared/attributes/address', attribute: :address_value %>
|
26
27
|
<%= render 'shared/attributes/option', attribute: :option_value %>
|
27
28
|
<%= render 'shared/attributes/options', attribute: :multiple_option_values %>
|
28
29
|
<%= render 'shared/attributes/option', attribute: :super_select_value %>
|
@@ -95,6 +95,10 @@ en:
|
|
95
95
|
_: &phone_field_value Phone Field Value
|
96
96
|
label: *phone_field_value
|
97
97
|
heading: *phone_field_value
|
98
|
+
address_value:
|
99
|
+
_: &address_value Address Value
|
100
|
+
label: *address_value
|
101
|
+
heading: *address_value
|
98
102
|
option_value:
|
99
103
|
_: &option_value Option Value
|
100
104
|
label: *option_value
|
@@ -215,6 +219,7 @@ en:
|
|
215
219
|
file_field_value: *file_field_value
|
216
220
|
password_field_value: *password_field_value
|
217
221
|
phone_field_value: *phone_field_value
|
222
|
+
address_value: *address_value
|
218
223
|
option_value: *option_value
|
219
224
|
multiple_option_values: *multiple_option_values
|
220
225
|
super_select_value: *super_select_value
|
@@ -111,8 +111,8 @@ class Scaffolding::Attribute
|
|
111
111
|
if is_ids?
|
112
112
|
# user_ids should be 'Users'
|
113
113
|
name_without_ids.humanize.titlecase
|
114
|
-
elsif is_id?
|
115
|
-
|
114
|
+
elsif is_id? && is_vanilla?
|
115
|
+
"#{name.humanize.titlecase} ID"
|
116
116
|
else
|
117
117
|
name.humanize.titlecase
|
118
118
|
end
|
@@ -820,7 +820,7 @@ class Scaffolding::Transformer
|
|
820
820
|
|
821
821
|
# this gets stripped and is one line, so indentation isn't a problem.
|
822
822
|
field_content = <<-ERB
|
823
|
-
<%= render 'shared/attributes/#{attribute.partial_name}', attribute: :#{attribute.name_without_id_suffix} %>
|
823
|
+
<%= render 'shared/attributes/#{attribute.partial_name}', attribute: :#{attribute.is_vanilla? ? attribute.name : attribute.name_without_id_suffix} %>
|
824
824
|
ERB
|
825
825
|
|
826
826
|
if attribute.type == "password_field"
|
@@ -839,7 +839,7 @@ class Scaffolding::Transformer
|
|
839
839
|
unless cli_options["skip-table"]
|
840
840
|
|
841
841
|
# table header.
|
842
|
-
field_content = "<th#{cell_attributes.present? ? " " + cell_attributes : ""}><%= t('.fields.#{attribute.name_without_id_suffix}.heading') %></th>"
|
842
|
+
field_content = "<th#{cell_attributes.present? ? " " + cell_attributes : ""}><%= t('.fields.#{attribute.is_vanilla? ? attribute.name : attribute.name_without_id_suffix}.heading') %></th>"
|
843
843
|
|
844
844
|
unless ["Team", "User"].include?(child)
|
845
845
|
scaffold_add_line_to_file("./app/views/account/scaffolding/completely_concrete/tangible_things/_index.html.erb", field_content, "<%# 🚅 super scaffolding will insert new field headers above this line. %>", prepend: true)
|
@@ -867,7 +867,7 @@ class Scaffolding::Transformer
|
|
867
867
|
|
868
868
|
# this gets stripped and is one line, so indentation isn't a problem.
|
869
869
|
field_content = <<-ERB
|
870
|
-
<td#{cell_attributes}><%= render 'shared/attributes/#{attribute.partial_name}', attribute: :#{attribute.name_without_id_suffix}#{", #{table_cell_options.join(", ")}" if table_cell_options.any?} %></td>
|
870
|
+
<td#{cell_attributes}><%= render 'shared/attributes/#{attribute.partial_name}', attribute: :#{attribute.is_vanilla? ? attribute.name : attribute.name_without_id_suffix}#{", #{table_cell_options.join(", ")}" if table_cell_options.any?} %></td>
|
871
871
|
ERB
|
872
872
|
|
873
873
|
if attribute.type == "password_field"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train-super_scaffolding
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|