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

Wrong More Examples section in README.md #200

Closed
pozabil opened this issue Oct 19, 2023 · 2 comments · Fixed by #220
Closed

Wrong More Examples section in README.md #200

pozabil opened this issue Oct 19, 2023 · 2 comments · Fixed by #220
Labels
bug Something isn't working

Comments

@pozabil
Copy link

pozabil commented Oct 19, 2023

https://github.com/igorkasyanchuk/active_storage_validations#more-examples
- Content type validation using symbols. In order to infer the correct mime type from the symbol, the types must be registered with Marcel::EXTENSIONS (MimeMagic::EXTENSIONS for Rails <= 6.1.3).
However, the description is incorrect, because marcel gem uses in all the latest stable versions:
Late Friday, Rails 5.2.5, 6.0.3.6 and 6.1.3.1 were posted with a revised version of its Active Storage service that replaces its mimemagic dependency with Marcel 1.0.0.
And also, marcel gem is included in the dependencies now.

@Mth0158 Mth0158 added the bug Something isn't working label Nov 21, 2023
@Mth0158
Copy link
Collaborator

Mth0158 commented Nov 21, 2023

Hi @pozabil,
Thanks for raising this issue.
As I understand it, this line is a warning for those who did not update their Rails versions to 5.2.5, 6.0.3.6 or 6.1.3.1, they should use the registered types used in MimeMagic::EXTENSIONS (or Marcel::EXTENSIONS for those who updated).

To me it's okay till this point. However, we do not use MimeMagic gem to check the content types anymore, we only use Marcel here.

So, from what I understand, we should either:

  • Conditionally use Marcel or MimeMagic based on Rails gem version
  • Remove support from MimeMagic by removing it from the README and from the gemfiles.lock (6.1 and global) => meaning we should at least update our Rails 6.1.0 gemfile to a higher version, to 6.1.7 for example (released more than 1 year ago) + we need to upgrade our marcel version to >= 1.0.0

Maybe we could also change the must be registered with formulation by must be registered by, it feels a bit easier to understand to me

@igorkasyanchuk what do you think? I'll go for upgrading our Rails 6.1.0 gemfile since MimeMagic is only used by Rails < 6.1.3.1 versions which has been released 2 years and half ago + Rails 6.1 is reaching EOL in 6 months (https://endoflife.date/rails)

@igorkasyanchuk
Copy link
Owner

@Mth0158 agree with idea of upgrading Rails 6.1 gemfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants