sb89
sb89

Reputation: 383

Deprecated message when adding MIME extension

I've added the following into initializers/mime_types.rb:

text_plain = MIME::Types["application/octet-stream"].first
text_plain.extensions << "fmf"
MIME::Types.index_extensions text_plain`

This works with Paperclip but I get the following message when running rspec:

MIME::Types#index_extensions is deprecated and will be private.

Are there any other methods of adding a new extension without using the above deprecated method?

Upvotes: 3

Views: 400

Answers (1)

mayatron
mayatron

Reputation: 1702

According to the thread at Thoughtbot Paperclip Issue #1737, you may be able to use the following pattern to avoid the deprecation warning.

text_plain = MIME::Types["application/octet-stream"].first
text_plain.add_extensions "fmf"

Sorry this answer may not be helpful a year later, but perhaps someone else will find it useful.

Upvotes: 4

Related Questions