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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69049eecf69e00aaebd2891815d7b886490558fd2d8bc9b8eeb1aa93c040fc00
4
- data.tar.gz: 533dd02a66be62440945a35370519e6b1ab5fd628a76334049c30a456d702f2d
3
+ metadata.gz: bbcde213b30f69abe18110f85a59c1e5b19d7f4bdfcb31cf587fbe28918c382e
4
+ data.tar.gz: c64d0d9b5e650e198fc25694ad24e53d914e3e3fee3954d87bcbe3e384989def
5
5
  SHA512:
6
- metadata.gz: a010c23a22da1aca8c235e391ec202f472de91ed0318d6351960b9c3938a88b806236dc98d0f85b00abe69339cca1a392a3b6f1f62b3ce90b7bf852beaf4d4b7
7
- data.tar.gz: 3197605e945e7bf4b28b36110aa06ba4ce51a6e7b2abd16f2f5c05aa62cbf958e963f99401844fab014a13552c06fad97d6e3dbd222b44fcc45daad1f2038208
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
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
- VERSION = "1.3.21"
3
+ VERSION = "1.3.23"
4
4
  end
5
5
  end
@@ -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
- name_without_id.humanize.titlecase
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.21
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-08-31 00:00:00.000000000 Z
11
+ date: 2023-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard