Repository navigation
Release 2.0.0 - #57
Merged
Merged
Conversation
Major, not minor: the selectors build a different string than 1.0.0 did
for the same input, so a suite that passed on 1.0.0 can fail on this
version without changing a line. `col-email` becomes `col-e-mail`,
`col-fullname` becomes `col-full_name`, `col-customers_name` becomes
`col-customer_s_name`.
Also documents how labels and model names become selectors, which the
README never covered. Three things bit a downstream suite today and all
three were invisible from the docs:
* normalizing a label yourself before handing it over now corrupts it,
because the gem makes the same `parameterize` call ActiveAdmin does
* `row :salary, class: 'money'` makes ActiveAdmin emit no `row-*`
class at all, so no label can address it
* `have_table(resource_name:)` follows the name a resource was
registered under, while `have_attributes_table(model:)` follows the
model class — `register Model, as: 'Other'` splits the two
Every selector in the new table was computed by running the gem, not
written from memory.
senid231
approved these changes
Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why major
The selectors build a different string than 1.0.0 did for the same input, so a suite that passed on 1.0.0 can fail on this version without a line changing:
'E-mail'col-emailcol-e-mail:full_namecol-fullnamecol-full_name"Customer's Name"col-customers_namecol-customer_s_name'Billing::Employee'billing::employee(raises)billing_employeeThat is a breaking change by SemVer, and the gem's README commits to SemVer. 1.0.0 → 2.0.0.
The sharpest case is a consumer who worked around the old behaviour: a helper that pre-normalized labels before calling these selectors passed on 1.0.0 and breaks here, because normalizing twice strips the separator the first pass inserted. That is called out in the migration notes and in the new README section.
What is in this PR
version.rb1.0.0 → 2.0.0CHANGELOG.md: a dated## [2.0.0]headingREADME.md: a new How labels become selectors sectionThe README section
The README had no reference for any of this —
spec/supportandtest_helpers.rbwere the only pointers, and neither explains how a label turns into a selector. Three things cost a downstream suite a day today, and all three were invisible from the docs:parameterize(separator: '_')call ActiveAdmin makes; doing it first corrupts the result.row :salary, class: 'money'makes ActiveAdmin emit norow-*class at all (if options[:class] … elsif title.present?), so no label can address that row. Match on text.have_attributes_table(model:)follows the model class,have_table(resource_name:)follows the registered resource name.register Billing::Employee, as: 'Business Employee'splits the two, and passing the class to the second one silently buildsindex_table_billing_employeesfor a table rendered asindex_table_business_employees.Plus the label→class table, and the two cases where there is no class to match (own
class:, and a labelparameterizecannot transliterate).Verification
Every selector in the new table was produced by running the gem, not written from memory:
The two model-name examples were read off real rendered pages earlier today: the dummy renders
<div class="attributes_table billing_employee">and<table id="index_table_business_employees">.Suite: 34 examples, 0 failures on this branch (42 once #55 and #56 are in).