This project is archived and is in readonly mode.

#1394 ✓committed
Tekin

compute_asset_host bombs when asset_host = Proc and called from a Mailer

Reported by Tekin | November 17th, 2008 @ 09:59 PM | in 2.x

compute_asset_host is falling over when used in Mailer views under certain conditions.

If you set asset_host to a 2 arguement Proc, compute_asset_host calls the Proc, passing in the source and the request object. Problem is, Mailer objects will not have a request object so compute_asset_host falls over with an undefined method error.

This simple patch updates compute_asset_host to pass nil in place of the request if no request is present. This way, you can write your Proc to cope with a nil request if necessary.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages