-
Notifications
You must be signed in to change notification settings - Fork 137
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
Use default on record
filter when given an empty string
#503
Comments
Attempted to also demonstrate this with a unit test in this commit, though i'm not confident this is the right place to specify the behavior i'm proposing. |
solebared
added a commit
to rubyforgood/mutual-aid
that referenced
this issue
Apr 3, 2021
`active_interaction` doesn't coerce an empty string value to the default value on `record` filters[1]. This causes the form to break on any form where `location_type` is optional (eg CommunityResources#create). We hadn't run into this on the Ask|Offer form because we only show the location_type input once the user provides an address, and then rely on the browser to enforce that it's populated. [1] AaronLasseigne/active_interaction#503
8 tasks
solebared
added a commit
to rubyforgood/mutual-aid
that referenced
this issue
Apr 3, 2021
`active_interaction` doesn't coerce an empty string value to the default value on `record` filters[1]. This causes the form to break on any form where `location_type` is optional (eg CommunityResources#create). We hadn't run into this on the Ask|Offer form because we only show the location_type input once the user provides an address, and then rely on the browser to enforce that it's populated. [1] AaronLasseigne/active_interaction#503
AaronLasseigne
added a commit
that referenced
this issue
Apr 3, 2022
This will be in the |
AaronLasseigne
added a commit
that referenced
this issue
Apr 3, 2022
AaronLasseigne
added a commit
that referenced
this issue
Apr 9, 2022
AaronLasseigne
added a commit
that referenced
this issue
May 31, 2022
AaronLasseigne
added a commit
that referenced
this issue
Jun 17, 2022
AaronLasseigne
added a commit
that referenced
this issue
Jun 24, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for fixing #412 in v4, this really does help with using AI for form objects.
It appears however that 5a5337c did not cover
record
filters? Perhaps this was intentional, but i think treating a blank/empty input string asnil
could also apply here.For example, say we have a form for creating an
Issue
,where
assignee
is selected with a dropdown on the frontend, but is optional.When the user omits the assignee,
params
would still includeassignee: ''
.Passing params directly into the interactor would then fail:
I think it would be intuitive for AI to assign the default value here, as is the case with other filters.
The text was updated successfully, but these errors were encountered: