rails/rails — pull request #14688 by straydogstudio (2014-04-10 17:00:52+00:00)
Title: Don't reduce lookup context formats

In Rails 3 or 4.0 the you could render an attachment inside a mailer:

```ruby
class Notifier < ActionMailer::Base
def instructions(user)
xlsx = render handlers: [:axlsx], template: 'users/mailers/instructions', layout: false
attachments["user.xlsx"] = {mime_type: Mime::XLSX, content: xlsx}

mail :to => user.email, :subject => 'Instructions'
end
end
```

With 4.1 the lookup context reduces the formats list to `:xlsx` and the following template lookup tries to find `instructions.xlsx.axlsx` instead of `instructions.html.erb`.

This fixes the problem. I assume `lookup_context.formats = [format.to_sym]` was to increase lookup efficiency thereafter. There may be a better way.

All actionview, actionpack, actionmailer, actionsupport tests pass. I'm still getting familiar with the Rails test suite. If someone can suggest where to place templates / test code I'll write one up.