Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select field selected value #1844

Merged
merged 2 commits into from
Dec 19, 2020

Conversation

nhippenmeyer
Copy link
Contributor

@nhippenmeyer nhippenmeyer commented Dec 16, 2020

When using the select field for a boolean attribute that can be either true, false or nil, the current behavior causes false and nil to be treated the same. If the attribute is set to false, the edit dashboard shows the selected value as being the nil option instead of false as expected.

@nhippenmeyer nhippenmeyer force-pushed the nch/select-field-selected-value branch from 2f17ede to 9be458a Compare December 16, 2020 00:59
@nhippenmeyer nhippenmeyer force-pushed the nch/select-field-selected-value branch from 9be458a to cb4a937 Compare December 16, 2020 01:03
@pablobm
Copy link
Collaborator

pablobm commented Dec 17, 2020

Good catch 👍 Would it be possible to add a test? Perhaps a view spec similar to https://github.com/thoughtbot/administrate/blob/cb4a93746e919ba9b3b0db2506e1f049f8feb67e/spec/administrate/views/fields/url/_form_spec.rb

@nhippenmeyer nhippenmeyer force-pushed the nch/select-field-selected-value branch 2 times, most recently from cc2356b to f156f9e Compare December 17, 2020 19:39
@nhippenmeyer
Copy link
Contributor Author

@pablobm done!

@nhippenmeyer nhippenmeyer force-pushed the nch/select-field-selected-value branch from f156f9e to 5846e55 Compare December 17, 2020 19:52
@pablobm pablobm merged commit 33a46ff into thoughtbot:master Dec 19, 2020
@pablobm
Copy link
Collaborator

pablobm commented Dec 19, 2020

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants