Fix missing options in select tags#6120
Merged
kennyadsl merged 2 commits intosolidusio:mainfrom Feb 14, 2025
Merged
Conversation
A small improvement on changes from solidusio#6091 where in Rails 7 calling `tag.method(@tag).parameters.any? { |_type, name| name == :content }` would always return false when @tag == :select, since `tag.select` method's signature has only `*` (:rest) as its parameter, thus not passing any `<option>`s for select tag. Somehow the problem was not being flagged by CI builds, but admin specs failed locally. Instead, use explicit void elements list to understand whether given element is void, therefore does not accept `content`.
d7746f7 to
f3e9082
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6120 +/- ##
==========================================
- Coverage 88.68% 86.63% -2.06%
==========================================
Files 830 512 -318
Lines 18013 11818 -6195
==========================================
- Hits 15975 10238 -5737
+ Misses 2038 1580 -458 ☔ View full report in Codecov by Sentry. |
kennyadsl
approved these changes
Feb 14, 2025
Member
kennyadsl
left a comment
There was a problem hiding this comment.
Rails really needs to provide a programmatic way to understand the type of tag from withing a Rails application, isn't it?
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.
Summary
A small improvement on changes from #6091 where in Rails 7 calling
tag.method(@tag).parameters.any? { |_type, name| name == :content }would always return false when @tag == :select, sincetag.selectmethod's signature has only*(:rest) as its parameter, thus not passing any<option>s for select tag.Somehow the problem was not being flagged by CI builds, but admin specs failed locally.
Instead, use explicit void elements list to understand whether given element is void, therefore does not accept
content.Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: