Skip to content

Commit

Permalink
Add CHANGELOG, UPGRADING
Browse files Browse the repository at this point in the history
Fix rubocop
  • Loading branch information
ericproulx committed Sep 26, 2024
1 parent efa9b2e commit 4df958c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* [#2497](https://github.com/ruby-grape/grape/pull/2497): Update RuboCop to 1.66.1 - [@ericproulx](https://github.com/ericproulx).
* [#2500](https://github.com/ruby-grape/grape/pull/2500): Remove deprecated `file` method - [@ericproulx](https://github.com/ericproulx).
* [#2501](https://github.com/ruby-grape/grape/pull/2501): Remove deprecated `except` and `proc` options in values validator - [@ericproulx](https://github.com/ericproulx).
* Your contribution here.

#### Fixes
Expand Down
2 changes: 1 addition & 1 deletion UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Upgrading Grape
- Deprecated `file` method has been removed. Use `send_file` or `stream`.
See [#2500](https://github.com/ruby-grape/grape/pull/2500)

- `except` and `proc` options has been removed from the `values` validator. Use `except validator` or assign `proc` directly to `values`
- `except` and `proc` options have been removed from the `values` validator. Use `except validator` or assign `proc` directly to `values`.
See [#2501](https://github.com/ruby-grape/grape/pull/2501)

### Upgrading to >= 2.2.0
Expand Down
12 changes: 6 additions & 6 deletions lib/grape/validations/validators/values_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ def validate_param!(attr_name, params)
# don't forget that +false.blank?+ is true
return if val != false && val.blank? && @allow_blank

unless check_values?(val, attr_name)
raise Grape::Exceptions::Validation.new(
params: [@scope.full_name(attr_name)],
message: message(:values)
)
end
return if check_values?(val, attr_name)

raise Grape::Exceptions::Validation.new(
params: [@scope.full_name(attr_name)],
message: message(:values)
)
end

private
Expand Down

0 comments on commit 4df958c

Please sign in to comment.