bullet_train-super_scaffolding 1.6.38 → 1.7.0

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: 198851d32bbd22c69dc8a458c4ace8fca717fb39851d3d52a5031adf60a52cb2
4
- data.tar.gz: 6d62f1e6d2adda33ecbed048511043e32c7af3d587e5e42e24e8255b88083f1e
3
+ metadata.gz: 9d2df60ec824d29acc3431e8da35d02a0704ea203c08e57f071d2f9b5e64c049
4
+ data.tar.gz: f5cf83e0d0a86e5723d84624dd7e20d6e42f2f68bfb6952cdb1ee9dfbfad8081
5
5
  SHA512:
6
- metadata.gz: 4e4d21f2432fa430715dff5164c0b7a3f80d21cfd699438d8a748be9238cdd8ee4f75c3e8742b36d179ccdcb826c75b79b9dddea17e21dffb8ace4179792b5e6
7
- data.tar.gz: 3db261b162e6570a2176be163f42c918bb50a869ec1295f49e743e91d0ef7e561a7ff1dc049de31bbfeed78c6af4024a46410d76fa5d2ad430a97b20883055c6
6
+ metadata.gz: 24170b35887d5a411b236735f25408b3eaa21d385d9b084f4989d6a92f73aaca49e3671b5e0df062a910d01586eb4293dc6cfd2770c8ca89e453949e4c52a67e
7
+ data.tar.gz: 3e56b3b813959edd8113c5ae5d9e02515016501992ab317e359c0a0e8d6aeb80a15045f02dfea66d1e799a3b132afda1e56f3b079c95ff14047188262f5da66d
@@ -16,7 +16,7 @@
16
16
  </div>
17
17
 
18
18
  <div class="sm:col-span-1">
19
- <%= render 'shared/fields/buttons', method: :multiple_button_values, multiple: true %>
19
+ <%= render 'shared/fields/buttons', method: :multiple_button_values, options: {multiple: true} %>
20
20
  </div>
21
21
  </div>
22
22
 
@@ -33,7 +33,7 @@
33
33
  </div>
34
34
 
35
35
  <div class="sm:col-span-1 pr-0 sm:pr-10">
36
- <%= render 'shared/fields/options', method: :multiple_option_values, multiple: true %>
36
+ <%= render 'shared/fields/options', method: :multiple_option_values, options: {multiple: true} %>
37
37
  </div>
38
38
  </div>
39
39
 
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
- VERSION = "1.6.38"
3
+ VERSION = "1.7.0"
4
4
  end
5
5
  end
@@ -732,19 +732,7 @@ class Scaffolding::Transformer
732
732
  # add_additional_step :yellow, transform_string("We've added a reference to a `placeholder` to the form for the select or super_select field, but unfortunately earlier versions of the scaffolded locales Yaml don't include a reference to `fields: *fields` under `form`. Please add it, otherwise your form won't be able to locate the appropriate placeholder label.")
733
733
  end
734
734
 
735
- if attribute.type == "color_picker"
736
- field_options[:color_picker_options] = "t('#{child.pluralize.underscore}.fields.#{attribute.name}.options')"
737
- end
738
-
739
- # When rendering a super_select element we need to use `html_options: {multiple: true}`,
740
- # but all other fields simply use `multiple: true` to work.
741
- if attribute.is_multiple?
742
- if attribute.type == "super_select"
743
- field_options[:multiple] = "true"
744
- else
745
- field_attributes[:multiple] = "true"
746
- end
747
- end
735
+ field_options[:multiple] = "true" if attribute.is_multiple?
748
736
 
749
737
  valid_values = if attribute.is_id?
750
738
  "valid_#{attribute.name_without_id.pluralize}"
@@ -754,7 +742,7 @@ class Scaffolding::Transformer
754
742
 
755
743
  # https://stackoverflow.com/questions/21582464/is-there-a-ruby-hashto-s-equivalent-for-the-new-hash-syntax
756
744
  if field_options.any? || options.any?
757
- field_options_key = if ["buttons", "super_select", "options"].include?(attribute.type)
745
+ field_options_key = if attribute.type == "super_select"
758
746
  if options.any?
759
747
  field_attributes[:options] = "{" + field_options.map { |key, value| "#{key}: #{value}" }.join(", ") + "}"
760
748
  end
@@ -779,6 +767,10 @@ class Scaffolding::Transformer
779
767
  end
780
768
  end
781
769
 
770
+ if attribute.type == "color_picker"
771
+ field_attributes[:color_picker_field_options] = "t('#{child.pluralize.underscore}.fields.#{attribute.name}.options')"
772
+ end
773
+
782
774
  field_content = "<%= render 'shared/fields/#{attribute.type}'#{", " if field_attributes.any?}#{field_attributes.map { |key, value| "#{key}: #{value}" }.join(", ")} %>"
783
775
 
784
776
  # TODO Add more of these from other packages?
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.6.38
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-20 00:00:00.000000000 Z
11
+ date: 2024-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard