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 5.2 attachement purge on content type invalidation #64

Conversation

Mate2xo
Copy link

@Mate2xo Mate2xo commented Feb 25, 2020

Hi,
Following the #55 issue, here are 2 commits to get started:

  • The first one adds a failing test to check that an attached file with an invalid content type gets purged in rails 5.2
  • The second one is a lead that I used in my project (I had to use .purge in a controller), but as mentioned in the issue, it apparently messes up the validation callbacks. In this case, this messes up another seemingly unrelated test. You can use it to see where it fails, but another solution seems to be necessary. So this 2nd commit is just an example.

I'm still a beginner, so I hope this isn't too 'dirty'. Also, I would love to know your solution to this problem :)

This change makes the 'file purge on content type invalidation' test pass, but makes an apparently unrelated test (Matchers::SizeValidatorMatcher) fail.
This commit should not be merged, and is here only as an example
@igorkasyanchuk
Copy link
Owner

closing this for now, I think it's not a part of validator, and issue is fixed in newer rails versions as I understand

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

Successfully merging this pull request may close these issues.

None yet

2 participants