This repository has been archived by the owner on Jul 13, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Post processing callbacks are run on invalid attachments. #2462
Closed
jhawthorn opened this issue
Jul 6, 2017
· 3 comments
· Fixed by kreeti/kt-paperclip#16 · May be fixed by #2594
Closed
Post processing callbacks are run on invalid attachments. #2462
jhawthorn opened this issue
Jul 6, 2017
· 3 comments
· Fixed by kreeti/kt-paperclip#16 · May be fixed by #2594
Comments
I had a go at fixing this as you can see 🙈 I can only get the issue to bubble if I call |
saghaulor
added a commit
to saghaulor/paperclip
that referenced
this issue
Apr 26, 2018
- Because the processors were called on assignment, instead of during saving, the validations could never work correctly. This is because the built in validations use the values in the db columns to operate. However, since these are populated on assignment, the validations cannot run before the processors run. Moreover, any other type of validation not dependent on the db columns also cannot run, because the processors are called on assignment. The processors should be called during save which allows for validations to occur. - Fixed tests that assert the incorrect behavior - Closes thoughtbot#2462, Closes thoughtbot#2321, Closes thoughtbot#2236, Closes thoughtbot#2178, Closes thoughtbot#1960, Closes thoughtbot#2204
Looks like there's an open PR that will be merged, closing. |
saghaulor
added a commit
to saghaulor/paperclip
that referenced
this issue
Aug 19, 2018
- Because the processors were called on assignment, instead of during saving, the validations could never work correctly. This is because the built in validations use the values in the db columns to operate. However, since these are populated on assignment, the validations cannot run before the processors run. Moreover, any other type of validation not dependent on the db columns also cannot run, because the processors are called on assignment. The processors should be called during save which allows for validations to occur. - Fixed tests that assert the incorrect behavior - Closes thoughtbot#2462, Closes thoughtbot#2321, Closes thoughtbot#2236, Closes thoughtbot#2178, Closes thoughtbot#1960, Closes thoughtbot#2204
This has been fixed at https://github.com/kreeti/paperclip/commits/master. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
From the README
However in attachment.rb
The check for validity happens inside the
run_paperclip_callbacks
blocks, so the callbacks are always run.Reported by @karlentwistle in solidusio/solidus#2064
The text was updated successfully, but these errors were encountered: