bullet_train-super_scaffolding 1.19.2 → 1.20.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: 6f6f428c9eef4d8a025e45a77611b245ec88f3ff0e2f430f69eb4f43a8914664
4
- data.tar.gz: d9e0f448a6f8be29013e88191d1d96e7c54dc3d5e01b9ee3cf06e3cea2b3459e
3
+ metadata.gz: 8adf61bba2e54db1d7e85d65827fd10a961495e714bfc9b424cba7814fab8e7d
4
+ data.tar.gz: 269cf217a24b5420814e74f860896fea75393fe1f5cc70beabcb9d897cb42d01
5
5
  SHA512:
6
- metadata.gz: 56673ddc8c5f3c25bc78efd0c4313e0744fc175d1f79d887493629c04dc1c153cace84ce892aa30b96d12c72d09b713bd81ef365e66c5ca1983a946140ba8657
7
- data.tar.gz: 3b2b8df1d49e413757da0cedb3a0cc839ade270a001a5072c157332ea8141a3c7d7e7f2d3fa63d4a1f0424d4e131ed01b263edbc0c385220e3e750d2ae8c2a25
6
+ metadata.gz: 29bbf326ed78095e1944babf26b8ad6f898c639359554746ce83afadb8efd204cd16523827cca9d0325a272471cfd6f1201d8f5fad4964b11809a1fe1da3cbe6
7
+ data.tar.gz: 8d86da72a341975466eca6d0acf6a54887ca86a069a1c6b3dc220deca67757bd4bb800a9e18c1f3fe5e7fbfde17822b3951895cdd89538a5fa12b9e850a6af0d
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
- VERSION = "1.19.2"
3
+ VERSION = "1.20.0"
4
4
  end
5
5
  end
@@ -34,3 +34,4 @@ Field Partial Types:
34
34
  text_field: string
35
35
  number_field: integer
36
36
  trix_editor: text
37
+ code_editor: text
@@ -198,6 +198,8 @@ class Scaffolding::Attribute
198
198
  "text"
199
199
  when "text_area"
200
200
  "text"
201
+ when "code_editor"
202
+ "code_snippet"
201
203
  when "file_field"
202
204
  "file#{"s" if is_multiple?}"
203
205
  when "password_field"
@@ -27,7 +27,8 @@ FIELD_PARTIALS = {
27
27
  text_area: "text",
28
28
  text_field: "string",
29
29
  number_field: "integer",
30
- trix_editor: "text"
30
+ trix_editor: "text",
31
+ code_editor: "text"
31
32
  }
32
33
 
33
34
  # filter out options.
@@ -661,12 +661,13 @@ class Scaffolding::Transformer
661
661
  attributes.each_with_index do |attribute_definition, index|
662
662
  attribute = Scaffolding::Attribute.new(attribute_definition, scaffolding_options[:type], index)
663
663
 
664
- if attribute.is_first_attribute? && ["trix_editor", "ckeditor", "text_area"].include?(attribute.type)
664
+ if attribute.is_first_attribute? && ["trix_editor", "ckeditor", "text_area", "code_editor"].include?(attribute.type)
665
665
  puts ""
666
666
  puts "The first attribute of your model cannot be any of the following types:".red
667
667
  puts "1. trix_editor"
668
668
  puts "2. ckeditor"
669
669
  puts "3. text_area"
670
+ puts "4. code_editor"
670
671
  puts ""
671
672
  puts "Please ensure you have another attribute type as the first attribute for your model and try again."
672
673
 
@@ -682,7 +683,7 @@ class Scaffolding::Transformer
682
683
  end
683
684
 
684
685
  # don't do table columns for certain types of fields and attribute partials
685
- if ["trix_editor", "ckeditor", "text_area"].include?(attribute.type) || ["html", "has_many"].include?(attribute.partial_name)
686
+ if ["trix_editor", "ckeditor", "text_area", "code_editor"].include?(attribute.type) || ["html", "has_many"].include?(attribute.partial_name)
686
687
  cli_options["skip-table"] = true
687
688
  end
688
689
 
@@ -813,6 +814,8 @@ class Scaffolding::Transformer
813
814
 
814
815
  unless cli_options["skip-show"]
815
816
 
817
+ # TODO: Seems like this block of code is useless?
818
+ # standard:disable Lint/Void
816
819
  if attribute.is_id?
817
820
  <<~ERB
818
821
  <% if @tangible_thing.#{attribute.name_without_id} %>
@@ -836,6 +839,7 @@ class Scaffolding::Transformer
836
839
  <% end %>
837
840
  ERB
838
841
  end
842
+ # standard:enable Lint/Void
839
843
 
840
844
  # this gets stripped and is one line, so indentation isn't a problem.
841
845
  field_content = <<-ERB
data/lib/scaffolding.rb CHANGED
@@ -28,7 +28,8 @@ module Scaffolding
28
28
  "super_select",
29
29
  "text_area",
30
30
  "text_field",
31
- "trix_editor"
31
+ "trix_editor",
32
+ "code_editor"
32
33
  ].include?(type.gsub(/{.*}/, "")) # Pop off curly brackets such as `super_select{class_name=Membership}`
33
34
  end
34
35
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-super_scaffolding
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.2
4
+ version: 1.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-25 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: standard
@@ -231,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
231
  - !ruby/object:Gem::Version
232
232
  version: '0'
233
233
  requirements: []
234
- rubygems_version: 3.6.2
234
+ rubygems_version: 3.6.7
235
235
  specification_version: 4
236
236
  summary: Bullet Train Super Scaffolding
237
237
  test_files: []