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

Rails 7 compatibility: missing CHECKS constant in AttachmentSizeValidator #71

Closed
SeanLF opened this issue Dec 7, 2021 · 3 comments
Closed

Comments

@SeanLF
Copy link

SeanLF commented Dec 7, 2021

The CHECKS constant (as seen below) no longer exists in Rails 7. It seems to have been replaced by COMPARE_CHECKS
(there's also NUMBER_CHECKS & RANGE_CHECKS, though I don't think are relevant in this case)

unless value.send(CHECKS[option], option_value)

https://github.com/rails/rails/blob/ceb4b94baaf17f3a9f4ea795c83ec6c67211f737/activemodel/lib/active_model/validations/numericality.rb#L11-L14

@yorzi
Copy link

yorzi commented Dec 11, 2021

I encountered the error when upgrading my app to Rails 7:

uninitialized constant Paperclip::Validators::AttachmentSizeValidator::CHECKS

Did anyone figure out this?

@yorzi
Copy link

yorzi commented Dec 11, 2021

I submitted a PR for this: #73

@ssinghi
Copy link

ssinghi commented Dec 14, 2021

Merged and Fixed.

@ssinghi ssinghi closed this as completed Dec 14, 2021
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

No branches or pull requests

3 participants