backstage 0.1.19 → 0.1.20

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: 2957b81109e79d7f8d9935ff65cfcc5df2103d5c01c0b5cbded72a60bdda83df
4
- data.tar.gz: 39e53fdbc631a1f3fa9403ee90b28ff95bc99f92b1b64afd9628034871d6b9f4
3
+ metadata.gz: 5d0f1f9bfa3bf985f685d3a3ca9f35d456b027187b2aacc202f0c60ceaa6d8ea
4
+ data.tar.gz: f67bfdc266c424cb0cef290638d0fff5125f6d07a6d6a32d7748aef3a5d811cb
5
5
  SHA512:
6
- metadata.gz: 404cbb0f574358534405ac492274f54daafd0bf7806e9e145f3bd26e00beb286f7469296b3387788e1dc942d6243ce3ff2c7b0ba36f79c4d5b645ce7713c585f
7
- data.tar.gz: b8f301bbc8c2bddac0d38f3177f50e6d93cee8673d3e3b91515293449e1920e1be9acaa47cfd8a512d43e119363017cec863babba16d097aebf64f9b25505fa9
6
+ metadata.gz: f2c3d90855af38383d24f05582a2d27673436efa976f66b94b320db3f4a59a478e1e7abbec81222f574f5c18a538a26b3ce5a66166ecd2c9526bd9fff897698c
7
+ data.tar.gz: 5a05ad3f4cb47b577e0b32869da3309aae28d3bd90d4e9ad3ff9d862cbcb3cd0a4175188c9ee6c4da5ae3b4aad7e9855c2b5b02ba63c8eae420e088335e3e976
data/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.20] — 2026-07-21
11
+
12
+ ### Fixed
13
+
14
+ - `belongs_to` select menus now sort options by `display_column` by default instead of returning records in arbitrary database order. An explicit `order:` option can override the default (e.g. `c.belongs_to :country, display_column: :printable_name, order: :printable_name`).
15
+
10
16
  ## [0.1.19] — 2026-07-18
11
17
 
12
18
  ### Fixed
@@ -1,6 +1,6 @@
1
- <% assoc = field.association
2
- records = assoc.associated_class.all
3
- col = assoc.display_column %>
1
+ <% assoc = field.association
2
+ col = assoc.display_column
3
+ records = assoc.associated_class.order(assoc.order) %>
4
4
  <%= f.select field.name,
5
5
  records.map { |r| [r.public_send(col), r.id] },
6
6
  { include_blank: true },
@@ -24,6 +24,10 @@ module Backstage
24
24
  class_name.constantize
25
25
  end
26
26
 
27
+ def order
28
+ options[:order] || display_column
29
+ end
30
+
27
31
  def image_col
28
32
  options[:image_col] || :url
29
33
  end
@@ -1,3 +1,3 @@
1
1
  module Backstage
2
- VERSION = "0.1.19"
2
+ VERSION = "0.1.20"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backstage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.19
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gareth James
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-18 00:00:00.000000000 Z
11
+ date: 2026-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties