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

Allow symbols to be passed as extension aliases in Mime::Type.register #4012

Merged
merged 3 commits into from Dec 17, 2011

Conversation

justincampbell
Copy link
Contributor

I was trying to do this:

Mime::Type.register "text/markdown", :markdown, [], [:md, :mdown]

But that didn't work. This did:

Mime::Type.register "text/markdown", :markdown, [], ["md", "mdown"]

But since the symbol parameter gets turned into the extension, it was confusing to pass strings as extension aliases.

This patch lets you use strings or symbols, and allows the same for Mime::Type.register_alias.

I also added some tests.

josevalim added a commit that referenced this pull request Dec 17, 2011
Allow symbols to be passed as extension aliases in Mime::Type.register
@josevalim josevalim merged commit 9412130 into rails:master Dec 17, 2011
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