hot-glue 0.6.12 → 0.6.14

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: 1eacfaf1cc09c6a40597a8a0f3f2bda37e156f5ed63be68ff842de01a707dc5d
4
- data.tar.gz: 20b3c4134a1443c2c5d134a5f5bcdecfb2e13c749c856a1620ecb43209245e68
3
+ metadata.gz: 3e3938ec168ea29eb7311c82742601f1d19ceb5c670e909ddd6ab5efda1a8bca
4
+ data.tar.gz: 4a2a21046045ab745e0c2d3ba3b5faddab2507628e245d5caae159f9c6c8bca2
5
5
  SHA512:
6
- metadata.gz: 3c38593db0539b7259b05b3d3e86062f550d54f969c9a30ad9e2ffa035513c035e154a02ed3f9427def36a025929d0679b66ff0423fc7fdf4ae01623ffb2f540
7
- data.tar.gz: 6c661dff1800dc911b23681622992fe4e7ac5d554c107e32aa5577f94250022bfbd07be78d33b9c6acab4149aacc2e2ce1047b8f5fd3f728c49139f1db07a4c2
6
+ metadata.gz: 37aa5ce09632029e929cd9d085c48bab155ee4db0560e76d9a8bf9aac5ab541929fd604111674da4390383c123e3b7c53b2826a0a374e2de507f665bb440d49c
7
+ data.tar.gz: 50b1a2f1fac6ae0e144bb949c9febb63165a3eeec7d0780035998234e7b854631c949246c06886d0a75c9dc0baf83fe8103948981d2fec3167086ecff1c8fa34
data/README.md CHANGED
@@ -674,7 +674,9 @@ Applies a badge `bg-primary` to rows with opened_at truthy and `bg-secondary` to
674
674
  to display a badge on everything, use the `none` modifier with the
675
675
  `--modify=opened_at{none}[bg-dark]`
676
676
 
677
+ For the `$` modifier only, if the field name ends with `_cents`, the modifier will automatically divide the field by 100 before displaying it.
677
678
 
679
+ (This is consistent with Stripe'e paradigm to always store money in cents, and this way I force myself to put `_cents` on the end of my field names to remind myself that they are in cents.)
678
680
 
679
681
  ### `--alt-foreign-key-lookup=`
680
682
 
@@ -1749,7 +1751,14 @@ These automatic pickups for partials are detected at build time. This means that
1749
1751
 
1750
1752
  # VERSION HISTORY
1751
1753
 
1752
- #### 2025-02-19 - v0.6.12
1754
+ #### 2025-02-28 - v0.6.14
1755
+
1756
+ • fixes bug in association field involving scaffolds built without nesting
1757
+ • fixes bug in paginated display
1758
+ • when applying $ modifier to a numerical field, if the field ends with `_cents`, the number will be /100 before being displayed
1759
+
1760
+
1761
+ #### 2025-02-20 - v0.6.12
1753
1762
  • adds decimal field type (displays as float-- there is no special handling for decimal on the UI)
1754
1763
  • guard against polymorphic belongs_to -- not a full implementation for polymorphic fields, just hides the fields on the form; on the list uses to_label always
1755
1764
  • fixes heading with multiword names on downnested portals to display nicely capitalized
@@ -112,7 +112,7 @@ class AssociationField < Field
112
112
  # end
113
113
  elsif modify_as && modify_as[:typeahead]
114
114
  search_url = "#{namespace ? namespace + "_" : ""}" +
115
- modify_as[:nested].join("_") + ("_" if modify_as[:nested].any?) +
115
+ modify_as[:nested].join("_") + ( modify_as[:nested].any? ? "_" : "") +
116
116
  + "#{assoc.class_name.downcase.pluralize}_typeahead_index_url"
117
117
 
118
118
 
@@ -145,7 +145,11 @@ class Field
145
145
  res = +''
146
146
 
147
147
  if modify_as[:cast] && modify_as[:cast] == "$"
148
- res += "<%= number_to_currency(#{singular}.#{name}) %>"
148
+ if name.ends_with?("_cents")
149
+ res += "<%= number_to_currency(#{singular}.#{name} / 100) %>"
150
+ else
151
+ res += "<%= number_to_currency(#{singular}.#{name}) %>"
152
+ end
149
153
  elsif modify_as[:binary]
150
154
  res += "<%= #{singular}.#{name} ? '#{modify_as[:binary][:truthy]}' : '#{modify_as[:binary][:falsy]}' %>"
151
155
  elsif modify_as[:tinymce]
@@ -61,7 +61,7 @@
61
61
  %>
62
62
  <\% end %>
63
63
  <% if @paginate_per_page_selector %>
64
- <\%= form_with url: things_path, method: :get do |f| %>
64
+ <\%= form_with url: '<%= path_helper_plural(top_level: false) %>', method: :get do |f| %>
65
65
  Show per page
66
66
  <\%= f.collection_select "per", [10, 25, 100], :to_s, :to_s, {prompt: true, selected: params[:per]}, {onChange: "this.form.submit();"} %>
67
67
  <\% end %>
@@ -1,5 +1,5 @@
1
1
  module HotGlue
2
2
  class Version
3
- CURRENT = '0.6.12'
3
+ CURRENT = '0.6.14'
4
4
  end
5
5
  end
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.12
4
+ version: 0.6.14
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-02-20 00:00:00.000000000 Z
11
+ date: 2025-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails