bullet_train-super_scaffolding 1.31.0 → 1.33.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0aff9afd7bf07a622050638cabf50afc6e483e6cfeb78eee3c2a5a28f80e54ea
4
- data.tar.gz: 6acb7ff802866bfeab7d301841790a218b70452e118f8f6f931afb0d3407dcc7
3
+ metadata.gz: 0da17f03e73107e5987c35ea8ebba84818b252175e903fca7e259a7f6886f181
4
+ data.tar.gz: cf674be39ac9915bcf0bdb7bfe042f7bb71135d1186866fc2850d63796a0665b
5
5
  SHA512:
6
- metadata.gz: e40793565b57e1c435e521eeb14063be80dbd4a8701ac3c2cf5ce05180b3869f34e6c544b1f2ec2520b5596e737f9e0e7636487fc25fd260be6c939ce3fa80df
7
- data.tar.gz: 80a540352b20fa1fd360ee20921058cf79af510ea93aeb518efeac43a7432ae3ff1ace6db20b8858f2ccd26705aa90704e6ce56b108a05fa312814bc9660201b
6
+ metadata.gz: e184f11fd8a711c74fa5aeda5fd5d572f2e3cb44aef91147ed73be5005d773ce9bf8d2e12244f2e722e369a89ae30acc30fd92680dcb87c814d9d6b8b7adbf1e
7
+ data.tar.gz: 25316050ce440296f7262d9e61ce4512e762f2967c2d985c4b214aff65bec2b3f1badfd8a23430403c5e7f3eb98a0d6a6c1dd0c59bfb9fb1c000b323c6e6af11
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
- VERSION = "1.31.0"
3
+ VERSION = "1.33.0"
4
4
  end
5
5
  end
@@ -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
- "'Alternative String Value'"
219
+ "\"Alternative String Value\""
220
220
  when "email_field"
221
- "'another.email@test.com'"
221
+ "\"another.email@test.com\""
222
222
  when "phone_field"
223
- "'+19053871234'"
223
+ "\"+19053871234\""
224
224
  when "color_picker"
225
- "'#47E37F'"
225
+ "\"#47E37F\""
226
226
  end
227
227
  end
228
228
 
@@ -799,6 +799,10 @@ class Scaffolding::Transformer
799
799
  field_attributes[:color_picker_field_options] = "t('#{child.pluralize.underscore}.fields.#{attribute.name}.options')"
800
800
  end
801
801
 
802
+ if attribute.type == "code_editor" && attribute.options[:language]
803
+ field_attributes[:language] = "\"#{attribute.options[:language]}\""
804
+ end
805
+
802
806
  field_content = "<%= render 'shared/fields/#{attribute.type}'#{", " if field_attributes.any?}#{field_attributes.map { |key, value| "#{key}: #{value}" }.join(", ")} %>"
803
807
 
804
808
  # TODO Add more of these from other packages?
@@ -1028,17 +1032,17 @@ class Scaffolding::Transformer
1028
1032
 
1029
1033
  assertion = case attribute.type
1030
1034
  when "date_field"
1031
- "assert_equal_or_nil Date.parse(tangible_thing_data['#{attribute.name}']), tangible_thing.#{attribute.name}"
1035
+ "assert_equal_or_nil Date.parse(tangible_thing_data[\"#{attribute.name}\"]), tangible_thing.#{attribute.name}"
1032
1036
  when "date_and_time_field"
1033
- "assert_equal_or_nil DateTime.parse(tangible_thing_data['#{attribute.name}']), tangible_thing.#{attribute.name}"
1037
+ "assert_equal_or_nil DateTime.parse(tangible_thing_data[\"#{attribute.name}\"]), tangible_thing.#{attribute.name}"
1034
1038
  when "file_field"
1035
1039
  if attribute.is_multiple?
1036
- "assert_equal tangible_thing_data['#{attribute.name}'], @tangible_thing.#{attribute.name}.map{|file| rails_blob_path(file)} unless controller.action_name == 'create'"
1040
+ "assert_equal tangible_thing_data[\"#{attribute.name}\"], @tangible_thing.#{attribute.name}.map{|file| rails_blob_path(file)} unless controller.action_name == \"create\""
1037
1041
  else
1038
- "assert_equal tangible_thing_data['#{attribute.name}'], rails_blob_path(@tangible_thing.#{attribute.name}) unless controller.action_name == 'create'"
1042
+ "assert_equal tangible_thing_data[\"#{attribute.name}\"], rails_blob_path(@tangible_thing.#{attribute.name}) unless controller.action_name == \"create\""
1039
1043
  end
1040
1044
  else
1041
- "assert_equal_or_nil tangible_thing_data['#{attribute.name}'], tangible_thing.#{attribute.name}"
1045
+ "assert_equal_or_nil tangible_thing_data[\"#{attribute.name}\"], tangible_thing.#{attribute.name}"
1042
1046
  end
1043
1047
  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
1048
  end
@@ -1366,7 +1370,7 @@ class Scaffolding::Transformer
1366
1370
  # if needed, update the reference to the parent class name in the create_table migration
1367
1371
  current_transformer = Scaffolding::ClassNamesTransformer.new(child, parent, namespace)
1368
1372
  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: '#{current_transformer.parent_table_name}'}")
1373
+ replace_in_file(migration_file_name, "foreign_key: true", "foreign_key: {to_table: \"#{current_transformer.parent_table_name}\"}")
1370
1374
  end
1371
1375
 
1372
1376
  # update the factory generated by `rails g`.
@@ -1406,7 +1410,7 @@ class Scaffolding::Transformer
1406
1410
  unless cli_options["skip-parent"] || parent == "None"
1407
1411
  scaffold_add_line_to_file(
1408
1412
  "./app/views/account/scaffolding/absolutely_abstract/creative_concepts/show.html.erb",
1409
- "<%= render 'account/scaffolding/completely_concrete/tangible_things/index', tangible_things: @creative_concept.completely_concrete_tangible_things, hide_back: true %>",
1413
+ "<%= render \"account/scaffolding/completely_concrete/tangible_things/index\", tangible_things: @creative_concept.completely_concrete_tangible_things, hide_back: true %>",
1410
1414
  "<%# 🚅 super scaffolding will insert new children above this line. %>",
1411
1415
  prepend: true
1412
1416
  )
@@ -1476,7 +1480,7 @@ class Scaffolding::Transformer
1476
1480
 
1477
1481
  unless cli_options["skip-model"]
1478
1482
  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)
1483
+ scaffold_add_line_to_file("./app/models/scaffolding/completely_concrete/tangible_thing.rb", "include Sortable\n\n", CONCERNS_HOOK, prepend: true)
1480
1484
 
1481
1485
  migration = Dir.glob("db/migrate/*").last
1482
1486
  migration_lines = File.open(migration).readlines
@@ -1486,7 +1490,7 @@ class Scaffolding::Transformer
1486
1490
  end
1487
1491
 
1488
1492
  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)
1493
+ 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
1494
  end
1491
1495
  end
1492
1496
 
@@ -1637,7 +1641,7 @@ class Scaffolding::Transformer
1637
1641
  end
1638
1642
  if icon_name.present?
1639
1643
  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 'account/scaffolding/completely_concrete/tangible_things/menu_item' %>", "<% # added by super scaffolding. %>")
1644
+ 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
1645
  end
1642
1646
  end
1643
1647
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-super_scaffolding
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.31.0
4
+ version: 1.33.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver