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

Fix custom validator not ending with _validator #2337

Merged
merged 4 commits into from
Jun 11, 2023

Conversation

ericproulx
Copy link
Contributor

Fix #2336

Add spec
@grape-bot
Copy link

grape-bot commented Jun 10, 2023

1 Warning
⚠️ There're library changes, but not tests. That's OK as long as you're refactoring existing code.

Generated by 🚫 Danger


RSpec.describe Grape::Validations::Validators::Base do
describe '#inherited' do
# I tried with `Class.new(Grape::Validations::Validators::Base) but `inherited` is not called.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHANGELOG.md Outdated
@@ -13,6 +13,7 @@
#### Fixes

* [#2328](https://github.com/ruby-grape/grape/pull/2328): Don't cache Class.instance_methods - [@byroot](https://github.com/byroot).
* [#2337](https://github.com/ruby-grape/grape/pull/2337): Fix custom validator registering - [@ericproulx](https://github.com/ericproulx).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's say "Fix: allow custom validators that do not end with _validator"?

@dblock
Copy link
Member

dblock commented Jun 10, 2023

1 Warning
⚠️ There're library changes, but not tests. That's OK as long as you're refactoring existing code.
Generated by 🚫 Danger

Hmmmm... this clearly isn't right.

Update spec comment
Add spec for anonymous class
@dblock dblock merged commit 1147658 into ruby-grape:master Jun 11, 2023
23 checks passed
@dblock
Copy link
Member

dblock commented Jun 11, 2023

Thanks for fixing this.

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.

Issue with CustomValidator if it's name doesn't end with "_validator"
3 participants