Skip to content

Instantly share code, notes, and snippets.

@remomueller
Last active February 20, 2017 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save remomueller/e2cfe63240e9b4c81ccc5bb2cd3821d1 to your computer and use it in GitHub Desktop.
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`.
# 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