class Rails::MailersController
def find_preferred_part(*formats) # :doc:
def find_preferred_part(*formats) # :doc: formats.each do |format| if part = @email.find_first_mime_type(format) return part end end if formats.any? { |f| @email.mime_type == f } @email end end