Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.