kreeti / kt-paperclip

Easy file attachment management for ActiveRecord
Other
275 stars 95 forks source link

Rails 7 compatibility: missing CHECKS constant in AttachmentSizeValidator #71

Closed SeanLF closed 2 years ago

SeanLF commented 2 years ago

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)

https://github.com/kreeti/kt-paperclip/blob/0b7bb0b455aea0fa961a25c0c74e2bd33ae99ba9/lib/paperclip/validators/attachment_size_validator.rb#L39

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

yorzi commented 2 years ago

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

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

Did anyone figure out this?

yorzi commented 2 years ago

I submitted a PR for this: https://github.com/kreeti/kt-paperclip/pull/73

ssinghi commented 2 years ago

Merged and Fixed.