Last active
February 20, 2017 14:45
-
-
Save remomueller/e2cfe63240e9b4c81ccc5bb2cd3821d1 to your computer and use it in GitHub Desktop.
Cleans up some deprecation notices that can clutter up tests on Ruby 2.4.0, can be placed in `config/initializers`.
This file contains 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
# Fixes gems that reference Fixnum explicitly. Replaces `Fixnum` with `0.class`. | |
# mail-2.6.4/lib/mail/attachments_list.rb:33 | |
module Mail | |
class AttachmentsList < Array | |
def [](index_value) | |
if index_value.is_a?(0.class) | |
self.fetch(index_value) | |
else | |
self.select { |a| a.filename == index_value }.first | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment