bullet_train-super_scaffolding 1.31.0 → 1.32.0
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/lib/bullet_train/super_scaffolding/version.rb +1 -1
- data/lib/scaffolding/attribute.rb +4 -4
- data/lib/scaffolding/transformer.rb +10 -10
- 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: b13f48c43eda622fe8a455cfad1531113a4625b9819afab72aadd29e532c77f3
|
|
4
|
+
data.tar.gz: 020d3cc93dcbf3cfd44d20ce7968be12d45fe5b7f2aba6b5b74747735f725ce2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 33e4b92f56495613846851ef3b87bf7029bdaff572bafe101b0bb222d77a582ddf73aef48133b71bfa4b66ff1f54c005aaecab403c0c10f41073504b1e4a34dc
|
|
7
|
+
data.tar.gz: 3f14badcc23122e374b772e277b42ec3d065ca4ab51582ab4e706ccf1bb53cc72f13c795c207b1c976447de4b4d3352f77458d262bf6c7e9d17e356f811212f2
|
|
@@ -216,13 +216,13 @@ class Scaffolding::Attribute
|
|
|
216
216
|
def default_value
|
|
217
217
|
case type
|
|
218
218
|
when "text_field", "password_field", "text_area"
|
|
219
|
-
"
|
|
219
|
+
"\"Alternative String Value\""
|
|
220
220
|
when "email_field"
|
|
221
|
-
"
|
|
221
|
+
"\"another.email@test.com\""
|
|
222
222
|
when "phone_field"
|
|
223
|
-
"
|
|
223
|
+
"\"+19053871234\""
|
|
224
224
|
when "color_picker"
|
|
225
|
-
"
|
|
225
|
+
"\"#47E37F\""
|
|
226
226
|
end
|
|
227
227
|
end
|
|
228
228
|
|
|
@@ -1028,17 +1028,17 @@ class Scaffolding::Transformer
|
|
|
1028
1028
|
|
|
1029
1029
|
assertion = case attribute.type
|
|
1030
1030
|
when "date_field"
|
|
1031
|
-
"assert_equal_or_nil Date.parse(tangible_thing_data[
|
|
1031
|
+
"assert_equal_or_nil Date.parse(tangible_thing_data[\"#{attribute.name}\"]), tangible_thing.#{attribute.name}"
|
|
1032
1032
|
when "date_and_time_field"
|
|
1033
|
-
"assert_equal_or_nil DateTime.parse(tangible_thing_data[
|
|
1033
|
+
"assert_equal_or_nil DateTime.parse(tangible_thing_data[\"#{attribute.name}\"]), tangible_thing.#{attribute.name}"
|
|
1034
1034
|
when "file_field"
|
|
1035
1035
|
if attribute.is_multiple?
|
|
1036
|
-
"assert_equal tangible_thing_data[
|
|
1036
|
+
"assert_equal tangible_thing_data[\"#{attribute.name}\"], @tangible_thing.#{attribute.name}.map{|file| rails_blob_path(file)} unless controller.action_name == \"create\""
|
|
1037
1037
|
else
|
|
1038
|
-
"assert_equal tangible_thing_data[
|
|
1038
|
+
"assert_equal tangible_thing_data[\"#{attribute.name}\"], rails_blob_path(@tangible_thing.#{attribute.name}) unless controller.action_name == \"create\""
|
|
1039
1039
|
end
|
|
1040
1040
|
else
|
|
1041
|
-
"assert_equal_or_nil tangible_thing_data[
|
|
1041
|
+
"assert_equal_or_nil tangible_thing_data[\"#{attribute.name}\"], tangible_thing.#{attribute.name}"
|
|
1042
1042
|
end
|
|
1043
1043
|
scaffold_add_line_to_file("./test/controllers/api/v1/scaffolding/completely_concrete/tangible_things_controller_test.rb", assertion, RUBY_NEW_FIELDS_HOOK, prepend: true)
|
|
1044
1044
|
end
|
|
@@ -1366,7 +1366,7 @@ class Scaffolding::Transformer
|
|
|
1366
1366
|
# if needed, update the reference to the parent class name in the create_table migration
|
|
1367
1367
|
current_transformer = Scaffolding::ClassNamesTransformer.new(child, parent, namespace)
|
|
1368
1368
|
unless current_transformer.parent_variable_name_in_context.pluralize == current_transformer.parent_table_name
|
|
1369
|
-
replace_in_file(migration_file_name, "foreign_key: true", "foreign_key: {to_table:
|
|
1369
|
+
replace_in_file(migration_file_name, "foreign_key: true", "foreign_key: {to_table: \"#{current_transformer.parent_table_name}\"}")
|
|
1370
1370
|
end
|
|
1371
1371
|
|
|
1372
1372
|
# update the factory generated by `rails g`.
|
|
@@ -1406,7 +1406,7 @@ class Scaffolding::Transformer
|
|
|
1406
1406
|
unless cli_options["skip-parent"] || parent == "None"
|
|
1407
1407
|
scaffold_add_line_to_file(
|
|
1408
1408
|
"./app/views/account/scaffolding/absolutely_abstract/creative_concepts/show.html.erb",
|
|
1409
|
-
"<%= render
|
|
1409
|
+
"<%= render \"account/scaffolding/completely_concrete/tangible_things/index\", tangible_things: @creative_concept.completely_concrete_tangible_things, hide_back: true %>",
|
|
1410
1410
|
"<%# 🚅 super scaffolding will insert new children above this line. %>",
|
|
1411
1411
|
prepend: true
|
|
1412
1412
|
)
|
|
@@ -1476,7 +1476,7 @@ class Scaffolding::Transformer
|
|
|
1476
1476
|
|
|
1477
1477
|
unless cli_options["skip-model"]
|
|
1478
1478
|
scaffold_add_line_to_file("./app/models/scaffolding/completely_concrete/tangible_thing.rb", "def collection\n absolutely_abstract_creative_concept.completely_concrete_tangible_things\nend\n\n", METHODS_HOOK, prepend: true)
|
|
1479
|
-
scaffold_add_line_to_file("./app/models/scaffolding/completely_concrete/tangible_thing.rb", "include Sortable\n", CONCERNS_HOOK, prepend: true)
|
|
1479
|
+
scaffold_add_line_to_file("./app/models/scaffolding/completely_concrete/tangible_thing.rb", "include Sortable\n\n", CONCERNS_HOOK, prepend: true)
|
|
1480
1480
|
|
|
1481
1481
|
migration = Dir.glob("db/migrate/*").last
|
|
1482
1482
|
migration_lines = File.open(migration).readlines
|
|
@@ -1486,7 +1486,7 @@ class Scaffolding::Transformer
|
|
|
1486
1486
|
end
|
|
1487
1487
|
|
|
1488
1488
|
unless cli_options["skip-controller"]
|
|
1489
|
-
scaffold_add_line_to_file("./app/controllers/account/scaffolding/completely_concrete/tangible_things_controller.rb", "include SortableActions\n", "Account::ApplicationController", increase_indent: true)
|
|
1489
|
+
scaffold_add_line_to_file("./app/controllers/account/scaffolding/completely_concrete/tangible_things_controller.rb", "include SortableActions\n\n", "Account::ApplicationController", increase_indent: true)
|
|
1490
1490
|
end
|
|
1491
1491
|
end
|
|
1492
1492
|
|
|
@@ -1637,7 +1637,7 @@ class Scaffolding::Transformer
|
|
|
1637
1637
|
end
|
|
1638
1638
|
if icon_name.present?
|
|
1639
1639
|
replace_in_file(transform_string("./config/locales/en/scaffolding/completely_concrete/tangible_things.en.yml"), "fal fa-puzzle-piece", icon_name)
|
|
1640
|
-
scaffold_add_line_to_file("./app/views/account/shared/_menu.html.erb", "<%= render
|
|
1640
|
+
scaffold_add_line_to_file("./app/views/account/shared/_menu.html.erb", "<%= render \"account/scaffolding/completely_concrete/tangible_things/menu_item\" %>", "<% # added by super scaffolding. %>")
|
|
1641
1641
|
end
|
|
1642
1642
|
end
|
|
1643
1643
|
end
|