bullet_train-super_scaffolding 1.7.17 → 1.7.18

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: fe1409d374421a05f03e3a685f540ce5dc28d1861aa8037594efbe1210fdc527
4
- data.tar.gz: 5e9cc70b508fe1829130471dbc78a06a4058f1c930d17d59007ef9d4c88078cc
3
+ metadata.gz: 97ac537cf45ae3404149f8cdfc4496d3af7fea1f50a85ae2b65f572ee7fcda35
4
+ data.tar.gz: 5e25e6a6bc6040e68a8aad37e322e72d1613ed0fb433393e3fd01808c79d64df
5
5
  SHA512:
6
- metadata.gz: 22c6d0f8f599ac0419a29fb6fd92bb7722b6981780552e3d55a84d88982687365cb5c815ee18accc7b6ba4e2679b539b9e09c18c186600af5052a97c3efea8d3
7
- data.tar.gz: c8dce7b4508b7c003a3f6aeb67f7dd76b877836d14242293116b23873da5731f3a775bd6d516b7f8ba1b8e1e12acba9f60dba0e71e379e3a8118b48262410c0b
6
+ metadata.gz: 7b7049fdb612615b1c6b85b38246539d5c99240308b2ed4c16d0011da3948fb66a40df04a8b95a7ce91c6f479da5bf49e88d7ad838ee6d70f6500d2b67f208ee
7
+ data.tar.gz: 54fcfbd4134ed0b3923c2d7c34e6ea727d757a13e03c56a8bf5f6d7def601b2c6f1a29eaaaea026a1d0ddea57921e52332d6c64fbc54c68429bb909ae0915d73
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
- VERSION = "1.7.17"
3
+ VERSION = "1.7.18"
4
4
  end
5
5
  end
@@ -178,10 +178,10 @@ class Scaffolding::Attribute
178
178
  # TODO: We're preserving cloudinary_image here for backwards compatibility.
179
179
  # Remove it in a future major release.
180
180
  options[:height] = 200
181
- "image"
181
+ "image#{"s" if is_multiple?}"
182
182
  when "image"
183
183
  options[:height] = 200
184
- "image"
184
+ "image#{"s" if is_multiple?}"
185
185
  when "phone_field"
186
186
  "phone_number"
187
187
  when "date_field"
@@ -146,11 +146,21 @@ def check_required_options_for_attributes(scaffolding_type, attributes, child, p
146
146
  {}
147
147
  end
148
148
 
149
+ if type == "image" && cloudinary_enabled? && attribute_options[:multiple]
150
+ puts "You have Cloudinary enabled and tried to scaffold an image field with the `multiple` option. " \
151
+ "At this time we do not support multiple images in a single Cloudinary image attribute. " \
152
+ "We hope to add support for it in the future. " \
153
+ "For now you could use individual named image attributes, or you might try disabling Cloudinary and using ActiveStorage.".red
154
+ exit
155
+ end
156
+
149
157
  data_type = if type == "image" && cloudinary_enabled?
150
158
  "string"
151
159
  elsif attribute_options[:multiple]
152
160
  case type
153
- when "file"
161
+ when "file_field"
162
+ "attachments"
163
+ when "image"
154
164
  "attachments"
155
165
  else
156
166
  "jsonb"
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.7.17
4
+ version: 1.7.18
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-07-11 00:00:00.000000000 Z
11
+ date: 2024-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard