Skip to content

Commit

Permalink
Use grep instead of select for class matching
Browse files Browse the repository at this point in the history
Co-authored-by: Vinicius Stock <[email protected]>
  • Loading branch information
Tonkpils and vinistock committed Sep 12, 2023
1 parent 7b3f895 commit c2340a8
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ def gather_constants

sig { override.void }
def decorate
confirmation_validators = constant.validators.select do |v|
v.is_a?(ActiveModel::Validations::ConfirmationValidator)
end
confirmation_validators = constant.validators.grep(ActiveModel::Validations::ConfirmationValidator)

return if confirmation_validators.empty?

Expand Down

0 comments on commit c2340a8

Please sign in to comment.