-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: validators checking aliased param instead of original one #1852
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,6 +155,16 @@ def initialize(value) | |
| expect(last_response.status).to eq(400) | ||
| expect(last_response.body).to eq('foo is empty') | ||
| end | ||
|
|
||
| it do | ||
| subject.params do | ||
| requires :foo, as: :bar, allow_blank: false | ||
| end | ||
| subject.get('/alias-not-blank-with-value') {} | ||
| get '/alias-not-blank-with-value', foo: 'any' | ||
|
|
||
| expect(last_response.status).to eq(200) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I get status 400 here with the As the alias ( Given that alias is just for internal usage (inside
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd tend to agree that this looks like a bug to me. Could you open an issue for this?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Thanks for looking at this!) |
||
| end | ||
| end | ||
|
|
||
| context 'array without coerce type explicitly given' do | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.