Use Mime[:foo] instead of Mime::Type[:FOO] for back compat#21869
Merged
jeremy merged 1 commit intorails:masterfrom Oct 6, 2015
Merged
Use Mime[:foo] instead of Mime::Type[:FOO] for back compat#21869jeremy merged 1 commit intorails:masterfrom
Mime[:foo] instead of Mime::Type[:FOO] for back compat#21869jeremy merged 1 commit intorails:masterfrom
Conversation
e21d990 to
bae817c
Compare
gsamokovarov
added a commit
to gsamokovarov/web-console
that referenced
this pull request
Oct 5, 2015
We have deprecated the reference of custom Mime-Types through Mime constants. See rails/rails@efc6dd5 and rails/rails#21869. I have to backport this to the 2-0-stable branch and will release a new 2.x.x release once #164 is resolved. Closes #167.
Rails 4.x and earlier didn't support `Mime::Type[:FOO]`, so libraries that support multiple Rails versions would've had to feature-detect whether to use `Mime::Type[:FOO]` or `Mime::FOO`. `Mime[:foo]` has been around for ages to look up registered MIME types by symbol / extension, though, so libraries and plugins can safely switch to that without breaking backward- or forward-compatibility. Note: `Mime::ALL` isn't a real MIME type and isn't registered for lookup by type or extension, so it's not available as `Mime[:all]`. We use it internally as a wildcard for `respond_to` negotiation. If you use this internal constant, continue to reference it with `Mime::ALL`. Ref. efc6dd5
bae817c to
565094a
Compare
jeremy
added a commit
that referenced
this pull request
Oct 6, 2015
Use `Mime[:foo]` instead of `Mime::Type[:FOO]` for back compat
Contributor
|
❤️ |
prathamesh-sonpatki
added a commit
to prathamesh-sonpatki/maildown
that referenced
this pull request
Jan 13, 2016
schneems
pushed a commit
to zombocom/maildown
that referenced
this pull request
Jan 13, 2016
walreyes
added a commit
to walreyes/write_xlsx_rails
that referenced
this pull request
Oct 31, 2017
This was referenced Jan 11, 2018
jarmopi
added a commit
to puavo-org/puavo-web
that referenced
this pull request
Aug 22, 2019
patrickm68
added a commit
to patrickm68/web-console
that referenced
this pull request
Dec 1, 2022
We have deprecated the reference of custom Mime-Types through Mime constants. See rails/rails@efc6dd5 and rails/rails#21869. I have to backport this to the 2-0-stable branch and will release a new 2.x.x release once #164 is resolved. Closes #167.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rails 4.x and earlier didn't support
Mime::Type[:FOO], so libraries that support multiple Rails versions would've had to feature-detect whether to useMime::Type[:FOO]orMime::FOO.Mime[:foo]has been around for ages to look up registered MIME types by symbol / extension, though, so libraries and plugins can safely switch to that without breaking backward- or forward-compatibility.Note:
Mime::ALLisn't a real MIME type and isn't registered for lookup by type or extension, so it's not available asMime[:all]. We use it internally as a wildcard forrespond_tonegotiation. If you use this internal constant, continue to reference it withMime::ALL.Ref. efc6dd5
cc @tenderlove