hot-glue 0.6.18 → 0.6.19
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/README.md +28 -4
- data/lib/generators/hot_glue/fields/association_field.rb +1 -1
- data/lib/generators/hot_glue/fields/boolean_field.rb +6 -6
- data/lib/generators/hot_glue/fields/field.rb +2 -3
- data/lib/generators/hot_glue/templates/controller.rb.erb +9 -4
- data/lib/hotglue/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e7085c942cab4dc377c75180d546b57f6ca76bdb3c96f3b2a837d1fdd887b0f
|
4
|
+
data.tar.gz: 04fd50131e53977f25c8817c7fd7bd33e34cb0aa784c995394c94302491b1426
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa984faeba62c9303c5ae0c64b32143e054289380ffdfecf2f0d457c7b2c2d69912b69901d78ee6fff75f1e6997ed19e86a4cc00a8c048341fbf2505e687a984
|
7
|
+
data.tar.gz: 052122bbbc7d15c134653efc4da2b74df8400447eccae13d395627bd5d79b2a616f612c97ac995f07b563a8589c9609406320562616f7efe637b94d7289a5e8a
|
data/README.md
CHANGED
@@ -1443,6 +1443,16 @@ If you leave the 2nd parameter blank when using the 3rd parameter, it will defau
|
|
1443
1443
|
|
1444
1444
|
`--attachments='avatar{thumbnail||direct}'`
|
1445
1445
|
|
1446
|
+
#### `--attachments` Long form syntax with 4 parameters
|
1447
|
+
|
1448
|
+
The final (4th) parameter should be `dropzone` to enable dropzone support for this attachment.
|
1449
|
+
|
1450
|
+
```
|
1451
|
+
bin/rails generate hot_glue:scaffold Video --auth='current_user' --auth-identifier='user' --namespace='account_dashboard' --nested='account' --smart-layout --attachments='video_file{thumbnail||direct|dropzone}'
|
1452
|
+
```
|
1453
|
+
|
1454
|
+
See below for dropzone details.
|
1455
|
+
|
1446
1456
|
|
1447
1457
|
#### For S3 Setup
|
1448
1458
|
|
@@ -1944,21 +1954,35 @@ These automatic pickups for partials are detected at build time. This means that
|
|
1944
1954
|
|
1945
1955
|
# VERSION HISTORY
|
1946
1956
|
|
1957
|
+
#### 2025-06-10 v0.6.19
|
1958
|
+
|
1959
|
+
• Fixes magic button output behavior to correctly show the string returned by the bang menthod
|
1960
|
+
• Fixes internal syntax of modify_as for modified fields; note default is now 'Yes' and 'No' for radio buttons
|
1961
|
+
• fixes destroy behavior with explicit .destroy! and ActiveRecord::RecordNotDestroyed; documents previously undocumented 4th parameter for attachment input
|
1962
|
+
|
1963
|
+
|
1947
1964
|
#### 2025-05-18 v0.6.18
|
1948
|
-
• Significant additions to `--alt-foreign-key-
|
1949
|
-
- on its
|
1965
|
+
• Significant additions to `--alt-foreign-key-lookup` which can now work:
|
1966
|
+
- on its own, without needing a factory (`--factory-creation`)
|
1950
1967
|
- with a factory
|
1951
1968
|
- with our without the hawk
|
1952
|
-
- in Gd mode
|
1969
|
+
- in Gd mode
|
1970
|
+
- if not in Gd mode, use with `--factory-creation` or use with the `--hawk`
|
1953
1971
|
|
1954
1972
|
See notes above for details.
|
1955
1973
|
|
1956
|
-
|
1974
|
+
example apps
|
1975
|
+
https://github.com/hot-glue-for-rails/HGHumanSpaMay25
|
1976
|
+
https://github.com/hot-glue-for-rails/HGAltLookups11
|
1977
|
+
|
1978
|
+
|
1979
|
+
• Adds Integer as searchable field
|
1957
1980
|
|
1958
1981
|
_ foo and bar are integers _
|
1959
1982
|
|
1960
1983
|
`rails g hot_glue:scaffold Thing --include=foo,bar --search=set --search-fields=foo,bar`
|
1961
1984
|
|
1985
|
+
• On show only association fields, view output is now safe-nil using `&` to not crash if the association doesn't exist.
|
1962
1986
|
|
1963
1987
|
|
1964
1988
|
#### 2025-05-09 - v0.6.17
|
@@ -23,9 +23,9 @@ class BooleanField < Field
|
|
23
23
|
|
24
24
|
def radio_button_display
|
25
25
|
" <%= f.radio_button(:#{name}, '0', checked: #{singular}.#{name} ? '' : 'checked', class: '#{@layout_strategy.form_checkbox_input_class}') %>\n" +
|
26
|
-
" <%= f.label(:#{name}, value: '#{modify_binary? && modify_as[
|
26
|
+
" <%= f.label(:#{name}, value: '#{modify_binary? && modify_as[:binary][:falsy] || 'No'}', for: '#{singular}_#{name}_0') %>\n" +
|
27
27
|
" <br /> <%= f.radio_button(:#{name}, '1', checked: #{singular}.#{name} ? 'checked' : '' , class: '#{@layout_strategy.form_checkbox_input_class}') %>\n" +
|
28
|
-
" <%= f.label(:#{name}, value: '#{modify_binary? && modify_as[
|
28
|
+
" <%= f.label(:#{name}, value: '#{modify_binary? && modify_as[:binary][:truthy] || 'Yes'}', for: '#{singular}_#{name}_1') %>\n"
|
29
29
|
end
|
30
30
|
|
31
31
|
def checkbox_display
|
@@ -59,9 +59,9 @@ class BooleanField < Field
|
|
59
59
|
"<% if #{singular}.#{name}.nil? %>
|
60
60
|
<span class=''>MISSING</span>
|
61
61
|
<% elsif #{singular}.#{name} %>
|
62
|
-
#{modify_as[
|
62
|
+
#{modify_as[:binary][:truthy]}
|
63
63
|
<% else %>
|
64
|
-
#{modify_as[
|
64
|
+
#{modify_as[:binary][:falsy]}
|
65
65
|
<% end %>"
|
66
66
|
else
|
67
67
|
"<% if #{singular}.#{name}.nil? %>
|
@@ -75,11 +75,11 @@ class BooleanField < Field
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def truthy_value
|
78
|
-
modify_as[
|
78
|
+
modify_as[:binary][:truthy] || 'Yes'
|
79
79
|
end
|
80
80
|
|
81
81
|
def falsy_value
|
82
|
-
modify_as[
|
82
|
+
modify_as[:binary][:falsy] || 'No'
|
83
83
|
end
|
84
84
|
|
85
85
|
def label_class
|
@@ -25,7 +25,7 @@ class Field
|
|
25
25
|
@form_placeholder_labels = scaffold.form_placeholder_labels
|
26
26
|
@ownership_field = scaffold.ownership_field
|
27
27
|
@form_labels_position = scaffold.form_labels_position
|
28
|
-
@modify_as = scaffold.modify_as
|
28
|
+
@modify_as = scaffold.modify_as[name.to_sym] # note whenever used as field, don't relookup the key
|
29
29
|
@display_as = scaffold.display_as
|
30
30
|
@pundit = scaffold.pundit
|
31
31
|
@plural = scaffold.plural
|
@@ -113,7 +113,7 @@ class Field
|
|
113
113
|
end
|
114
114
|
|
115
115
|
def viewable_output
|
116
|
-
if modify_as
|
116
|
+
if modify_as
|
117
117
|
modified_display_output(show_only: true)
|
118
118
|
else
|
119
119
|
field_view_output
|
@@ -159,7 +159,6 @@ class Field
|
|
159
159
|
# end
|
160
160
|
# res = "<span class='badge <%= #{badge_code} %>'>" + res + "</span>"
|
161
161
|
# end
|
162
|
-
# byebug
|
163
162
|
res
|
164
163
|
end
|
165
164
|
|
@@ -186,8 +186,13 @@ class <%= controller_class_name %> < <%= controller_descends_from %>
|
|
186
186
|
flash[:alert] = nil
|
187
187
|
<% @magic_buttons.each do |button| %>
|
188
188
|
if <%= singular_name %>_params[:__<%= button %>]
|
189
|
-
|
190
|
-
|
189
|
+
|
190
|
+
if res = @<%= singular_name %>.<%= button %>!
|
191
|
+
flash[:notice] << "<% singular %> <%= button.titlecase %>"
|
192
|
+
flash[:notice] << " #{res}" if res.is_a?(String)
|
193
|
+
else
|
194
|
+
flash[:alert] = " <%= button.titlecase %> failed."
|
195
|
+
end
|
191
196
|
end
|
192
197
|
<% end %>
|
193
198
|
|
@@ -254,9 +259,9 @@ class <%= controller_class_name %> < <%= controller_descends_from %>
|
|
254
259
|
skip_authorization
|
255
260
|
raise Pundit::NotAuthorizedError if ! <%= @pundit_policy_override %>.destroy?<% end %>
|
256
261
|
begin
|
257
|
-
@<%=singular_name%>.destroy
|
262
|
+
@<%=singular_name%>.destroy!
|
258
263
|
flash[:notice] = '<%= singular_name.titlecase %> successfully deleted'
|
259
|
-
rescue
|
264
|
+
rescue ActiveRecord::RecordNotDestroyed => e
|
260
265
|
flash[:alert] = '<%= singular_name.titlecase %> could not be deleted'
|
261
266
|
end
|
262
267
|
<%= post_action_parental_updates.join("\n ") %>
|
data/lib/hotglue/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hot-glue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Fleetwood-Boldt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|