<?xml version="1.0" encoding="UTF-8"?>
<ticket>
  <assigned-user-id type="integer">141</assigned-user-id>
  <attachments-count type="integer">3</attachments-count>
  <closed type="boolean">true</closed>
  <created-at type="datetime">2008-04-19T08:31:31+01:00</created-at>
  <creator-id type="integer">949</creator-id>
  <milestone-due-on type="datetime">2009-03-18T00:00:00+00:00</milestone-due-on>
  <milestone-id type="integer">9901</milestone-id>
  <number type="integer">22</number>
  <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
  <priority type="integer">11107</priority>
  <project-id type="integer">8994</project-id>
  <raw-data type="binary" nil="true" encoding="base64"></raw-data>
  <state>stale</state>
  <tag>actionpack routing</tag>
  <title>default_url_options is being ignored by named route optimisation</title>
  <updated-at type="datetime">2008-08-30T02:18:51+01:00</updated-at>
  <user-id type="integer">85</user-id>
  <user-name>Jeremy Kemper</user-name>
  <creator-name>Deepak Jois</creator-name>
  <assigned-user-name>Michael Koziarski</assigned-user-name>
  <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
  <milestone-title>2.1.1</milestone-title>
  <original-body>This is basically the same as 

http://dev.rubyonrails.org/ticket/10925

It seems that the reeason it happens is that the optimisation code for named routes uses the request.host_with_string and request.protocol without calling default_url_option at any time (as in the url_for method)</original-body>
  <latest-body>This is basically the same as 

http://dev.rubyonrails.org/ticket/10925

It seems that the reeason it happens is that the optimisation code for named routes uses the request.host_with_string and request.protocol without calling default_url_option at any time (as in the url_for method)</latest-body>
  <original-body-html>&lt;div&gt;&lt;p&gt;
This is basically the same as
&lt;/p&gt;&lt;p&gt;
&lt;a href=&quot;http://dev.rubyonrails.org/ticket/10925&quot;&gt;http://dev.rubyonrails.org/ticke...&lt;/a&gt;
&lt;/p&gt;&lt;p&gt;
It seems that the reeason it happens is that the optimisation code for named routes uses the request.host_with_string and request.protocol without calling default_url_option at any time (as in the url_for method)
&lt;/p&gt;&lt;/div&gt;</original-body-html>
  <versions type="array">
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>This is basically the same as 

http://dev.rubyonrails.org/ticket/10925

It seems that the reeason it happens is that the optimisation code for named routes uses the request.host_with_string and request.protocol without calling default_url_option at any time (as in the url_for method)</body>
      <body-html>&lt;div&gt;&lt;p&gt;
This is basically the same as
&lt;/p&gt;&lt;p&gt;
&lt;a href=&quot;http://dev.rubyonrails.org/ticket/10925&quot;&gt;http://dev.rubyonrails.org/ticke...&lt;/a&gt;
&lt;/p&gt;&lt;p&gt;
It seems that the reeason it happens is that the optimisation code for named routes uses the request.host_with_string and request.protocol without calling default_url_option at any time (as in the url_for method)
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-04-19T08:31:31+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-04-19T08:31:31+01:00</updated-at>
      <user-id type="integer">949</user-id>
      <user-name>Deepak Jois</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Here's a patch that checks for the existence of a non-blank #default_url_options and bypasses named route optimization: http://github.com/chuyeow/rails/commit/3bb863d63198080e26afbdc72e483315c8bc1be8</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Here's a patch that checks for the existence of a non-blank #default_url_options and bypasses named route optimization: &lt;a href=&quot;http://github.com/chuyeow/rails/commit/3bb863d63198080e26afbdc72e483315c8bc1be8&quot;&gt;http://github.com/chuyeow/rails/...&lt;/a&gt;
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-04-20T06:02:33+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-04-20T06:02:33+01:00</updated-at>
      <user-id type="integer">586</user-id>
      <user-name>Cheah Chu Yeow</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Attaching a patch instead - gonna delete my branch.</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Attaching a patch instead - gonna delete my branch.
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-04-27T12:44:57+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-04-27T12:44:57+01:00</updated-at>
      <user-id type="integer">586</user-id>
      <user-name>Cheah Chu Yeow</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>+1 applies cleanly on 6f20efd (Wed Apr 30 23:30:50 2008 -0500)

I've been bitten by this one, thanks for the patch</body>
      <body-html>&lt;div&gt;&lt;p&gt;
+1 applies cleanly on 6f20efd (Wed Apr 30 23:30:50 2008 -0500)
&lt;/p&gt;&lt;p&gt;
I've been bitten by this one, thanks for the patch
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-05-01T08:36:00+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-01T08:36:00+01:00</updated-at>
      <user-id type="integer">1023</user-id>
      <user-name>Ian White</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>+1 looks good, better than my local solution to the referenced ticket :) Patch applied fine to 74436d (Thu May 1 10:21:46 2008 +0100) after removing the empty line changes in action_controller/base.rb</body>
      <body-html>&lt;div&gt;&lt;p&gt;
+1 looks good, better than my local solution to the referenced ticket :) Patch applied fine to 74436d (Thu May 1 10:21:46 2008 +0100) after removing the empty line changes in action_controller/base.rb
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-05-01T16:07:12+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-01T16:07:12+01:00</updated-at>
      <user-id type="integer">2529</user-id>
      <user-name>Daniel Guettler</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>(from [6a6b4392c16c665eb713705f2b38e959a658eeef]) Ensure that default_url_options, if defined, are used in named routes.

Signed-off-by: Michael Koziarski &lt;michael@koziarski.com&gt;

[#22 state:resolved]
http://github.com/rails/rails/commit/6a6b4392c16c665eb713705f2b38e959a658eeef</body>
      <body-html>&lt;div&gt;&lt;p&gt;
(from [6a6b4392c16c665eb713705f2b38e959a658eeef]) Ensure that default_url_options, if defined, are used in named routes.
&lt;/p&gt;&lt;p&gt;
Signed-off-by: Michael Koziarski 
&lt;/p&gt;&lt;p&gt;
[#22 state:resolved]
&lt;/p&gt;&lt;p&gt;
&lt;a href=&quot;http://github.com/rails/rails/commit/6a6b4392c16c665eb713705f2b38e959a658eeef&quot;&gt;http://github.com/rails/rails/co...&lt;/a&gt;
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-05-04T01:50:24+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- 
:state: new
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-04T01:50:24+01:00</updated-at>
      <user-id type="integer">17393</user-id>
      <user-name>Repository</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>For the next major release we will probably deprecate / remove default_url_options.  But in the meantime nice patch.</body>
      <body-html>&lt;div&gt;&lt;p&gt;
For the next major release we will probably deprecate / remove default_url_options.  But in the meantime nice patch.
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-05-04T01:51:07+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-04T01:51:07+01:00</updated-at>
      <user-id type="integer">141</user-id>
      <user-name>Michael Koziarski</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Hmm, pity to see it go. I found it useful in cases where you want to add some parameters to the urls based on if some methods on a controller return a value or return nil.
E.g. an url may need a section_id to identify the area it's accessed from, but this is not needed always and can change dynamically. In this case you can add { :section_id =&gt; SomeController.section_id } to the default_url_options and don't have to worry about it anymore in each generated url.
Is there are better way to archive this?

Daniel</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Hmm, pity to see it go. I found it useful in cases where you want to add some parameters to the urls based on if some methods on a controller return a value or return nil.
&lt;/p&gt;&lt;p&gt;
E.g. an url may need a section_id to identify the area it's accessed from, but this is not needed always and can change dynamically. In this case you can add { :section_id =&gt; SomeController.section_id } to the default_url_options and don't have to worry about it anymore in each generated url.
&lt;/p&gt;&lt;p&gt;
Is there are better way to archive this?
&lt;/p&gt;&lt;p&gt;
Daniel
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-05-04T02:04:56+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-04T02:04:56+01:00</updated-at>
      <user-id type="integer">2529</user-id>
      <user-name>Daniel Guettler</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Thanks for applying the patch.

I agree with Daniel. I found the default_url_options quite useful for my app where I had to redirect from a subdomain to the main domain name for some pages. Without default_url_options, I would have to insert a hash with hostname and port into every url call.

It would be better to fix the optimisation of routes to take into account values from the default_url_options hash.</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Thanks for applying the patch.
&lt;/p&gt;&lt;p&gt;
I agree with Daniel. I found the default_url_options quite useful for my app where I had to redirect from a subdomain to the main domain name for some pages. Without default_url_options, I would have to insert a hash with hostname and port into every url call.
&lt;/p&gt;&lt;p&gt;
It would be better to fix the optimisation of routes to take into account values from the default_url_options hash.
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-05-04T05:33:30+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-04T05:33:30+01:00</updated-at>
      <user-id type="integer">949</user-id>
      <user-name>Deepak Jois</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>We definitely need something else which is like default_url_options, which is why we haven't removed it yet :).</body>
      <body-html>&lt;div&gt;&lt;p&gt;
We definitely need something else which is like default_url_options, which is why we haven't removed it yet :).
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-05-04T05:41:25+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-04T05:41:25+01:00</updated-at>
      <user-id type="integer">141</user-id>
      <user-name>Michael Koziarski</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Since this commit, all of my named_routes are failing with

@@@ruby
ArgumentError: wrong number of arguments (1 for 0)
        from (eval):2:in `default_url_options'
@@@

Example: (On a clean rails app, with rails at 6a6b439)

@@@ruby
  # (in routes.rb)
  map.resources :things
@@@

@@@ruby
$ script/console

&gt;&gt; include ActionController::UrlWriter
=&gt; Object
&gt;&gt; things_path
ArgumentError: wrong number of arguments (1 for 0)
        from (eval):2:in `default_url_options'
        from (eval):2:in `things_path'
        from (irb):3
@@@

I'm investigating a patch</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Since this commit, all of my named_routes are failing with
&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;uby&quot;&gt;ArgumentError: wrong number of arguments (1 for 0)
        from (eval):2:in `default_url_options'&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Example: (On a clean rails app, with rails at 6a6b439)
&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;uby&quot;&gt;  # (in routes.rb)
  map.resources :things&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code class=&quot;uby&quot;&gt;$ script/console

&amp;gt;&amp;gt; include ActionController::UrlWriter
=&amp;gt; Object
&amp;gt;&amp;gt; things_path
ArgumentError: wrong number of arguments (1 for 0)
        from (eval):2:in `default_url_options'
        from (eval):2:in `things_path'
        from (irb):3&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
I'm investigating a patch
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-05-04T16:27:54+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-04T16:27:54+01:00</updated-at>
      <user-id type="integer">1023</user-id>
      <user-name>Ian White</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Ack I see why that's a problem (and why it wasn't covered by existing tests nor my test in the applied patch) - default_url_options takes a single argument in AC::B but is simply a (hash) attribute in ActionController::UrlWriter.

Ian thanks for spotting this!

I'm attaching a patch that is a quick fix for this. Basically it gives AC::B#default_url_options a default argument. I didn't want to remove it since I imagine that would involve deprecation.</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Ack I see why that's a problem (and why it wasn't covered by existing tests nor my test in the applied patch) - default_url_options takes a single argument in AC::B but is simply a (hash) attribute in ActionController::UrlWriter.
&lt;/p&gt;&lt;p&gt;
Ian thanks for spotting this!
&lt;/p&gt;&lt;p&gt;
I'm attaching a patch that is a quick fix for this. Basically it gives AC::B#default_url_options a default argument. I didn't want to remove it since I imagine that would involve deprecation.
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-05-04T16:59:39+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-04T16:59:39+01:00</updated-at>
      <user-id type="integer">586</user-id>
      <user-name>Cheah Chu Yeow</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">2</attachments-count>
      <body>Btw, now I'm more convinced that default_url_options does need some cleaning up/re-thinking!</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Btw, now I'm more convinced that default_url_options does need some cleaning up/re-thinking!
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-05-04T17:00:48+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-04T17:00:48+01:00</updated-at>
      <user-id type="integer">586</user-id>
      <user-name>Cheah Chu Yeow</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">2</attachments-count>
      <body>Here's a testcase that fails on 6a6b43 but passes on the previous commit 437f918

(you have to paste the test into 437f918- the diff doesn't apply)</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Here's a testcase that fails on 6a6b43 but passes on the previous commit 437f918
&lt;/p&gt;&lt;p&gt;
(you have to paste the test into 437f918- the diff doesn't apply)
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-05-04T17:23:04+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-04T17:23:04+01:00</updated-at>
      <user-id type="integer">1023</user-id>
      <user-name>Ian White</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>No worries, uploaded my test patch without seeing Cheah Chu Yeow's updates updates on this ticket, you can just ignore it</body>
      <body-html>&lt;div&gt;&lt;p&gt;
No worries, uploaded my test patch without seeing Cheah Chu Yeow's updates updates on this ticket, you can just ignore it
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-05-04T17:25:32+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-04T17:25:32+01:00</updated-at>
      <user-id type="integer">1023</user-id>
      <user-name>Ian White</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>Does this need to re-opened as a new ticket?  I notice that it's status is 'resolved'.</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Does this need to re-opened as a new ticket?  I notice that it's status is 'resolved'.
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-05-04T20:20:02+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-04T20:20:02+01:00</updated-at>
      <user-id type="integer">1023</user-id>
      <user-name>Ian White</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>apostrophe man commin to get me...  I wish I could edit lighthouse comments</body>
      <body-html>&lt;div&gt;&lt;p&gt;
apostrophe man commin to get me...  I wish I could edit lighthouse comments
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-05-04T20:22:24+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-04T20:22:24+01:00</updated-at>
      <user-id type="integer">1023</user-id>
      <user-name>Ian White</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>Actually I see that Cheah Chu Yeow's patch doesn't include a regression test, so it might be useful to use the diff I attached for that.</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Actually I see that Cheah Chu Yeow's patch doesn't include a regression test, so it might be useful to use the diff I attached for that.
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-05-04T20:24:58+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-04T20:24:58+01:00</updated-at>
      <user-id type="integer">1023</user-id>
      <user-name>Ian White</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name nil="true"></assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">141</assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>I'll get to this today.</body>
      <body-html>&lt;div&gt;&lt;p&gt;
I'll get to this today.
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-05-04T22:52:40+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- 
:state: resolved
:assigned_user: 
:milestone: 
</diffable-attributes>
      <milestone-id type="integer">9901</milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>open</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-04T22:52:40+01:00</updated-at>
      <user-id type="integer">141</user-id>
      <user-name>Michael Koziarski</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name>Michael Koziarski</assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title>2.1.1</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">141</assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>Too slow!  I got it...</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Too slow!  I got it...
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-05-06T07:43:13+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9901</milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>open</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-06T07:43:13+01:00</updated-at>
      <user-id type="integer">1</user-id>
      <user-name>Rick</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name>Michael Koziarski</assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title>2.1.1</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">141</assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>(from [37599d16f2374179ebf001aeb79ff121e3d67519]) regression test for bug introduced in [6a6b4392c16c665eb713705f2b38e959a658eeef] [Ian White] [#22 state:resolved]
http://github.com/rails/rails/commit/37599d16f2374179ebf001aeb79ff121e3d67519</body>
      <body-html>&lt;div&gt;&lt;p&gt;
(from [37599d16f2374179ebf001aeb79ff121e3d67519]) regression test for bug introduced in [6a6b4392c16c665eb713705f2b38e959a658eeef] [Ian White] [#22 state:resolved]
&lt;/p&gt;&lt;p&gt;
&lt;a href=&quot;http://github.com/rails/rails/commit/37599d16f2374179ebf001aeb79ff121e3d67519&quot;&gt;http://github.com/rails/rails/co...&lt;/a&gt;
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-05-06T07:46:33+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- 
:state: open
</diffable-attributes>
      <milestone-id type="integer">9901</milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag nil="true"></tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-05-06T07:46:33+01:00</updated-at>
      <user-id type="integer">17393</user-id>
      <user-name>Repository</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name>Michael Koziarski</assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title>2.1.1</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">141</assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>This problem still arises for named routes used in views instead of controllers.  I have default_url_options defined in app/controllers/application.rb; routes that are generated from the controller seem to be fine, whereas routes generated from the views do not. 

Adding the following to app/helpers/application_helper.rb works around the issue:
@@@ruby
def default_url_options(options = nil)
    @controller.send(:default_url_options, options)
end
@@@</body>
      <body-html>&lt;div&gt;&lt;p&gt;
This problem still arises for named routes used in views instead of controllers.  I have default_url_options defined in app/controllers/application.rb; routes that are generated from the controller seem to be fine, whereas routes generated from the views do not.
&lt;/p&gt;&lt;p&gt;
Adding the following to app/helpers/application_helper.rb works around the issue:
&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;uby&quot;&gt;def default_url_options(options = nil)
    @controller.send(:default_url_options, options)
end&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-07-18T01:13:29+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- 
:tag: 
</diffable-attributes>
      <milestone-id type="integer">9901</milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>resolved</state>
      <tag>actionpack patch routing</tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-07-18T01:13:29+01:00</updated-at>
      <user-id type="integer">25003</user-id>
      <user-name>Phil Orwig</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name>Michael Koziarski</assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title>2.1.1</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">141</assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body></body>
      <body-html></body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-07-18T17:55:55+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- 
:tag: actionpack patch routing
:state: resolved
</diffable-attributes>
      <milestone-id type="integer">9901</milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>open</state>
      <tag>actionpack routing</tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-07-18T17:55:55+01:00</updated-at>
      <user-id type="integer">1366</user-id>
      <user-name>Pratik</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name>Michael Koziarski</assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title>2.1.1</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">141</assigned-user-id>
      <attachments-count type="integer">3</attachments-count>
      <body>This looks like a simple fix, but it's growing stale here. Please write a test and submit a patch.</body>
      <body-html>&lt;div&gt;&lt;p&gt;This looks like a simple fix, but it's growing stale here.
Please write a test and submit a patch.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-08-30T02:18:51+01:00</created-at>
      <creator-id type="integer">949</creator-id>
      <diffable-attributes type="yaml">--- 
:state: open
</diffable-attributes>
      <milestone-id type="integer">9901</milestone-id>
      <number type="integer">22</number>
      <permalink>default_url_options-is-being-ignored-by-named-route-optimisation-2</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>stale</state>
      <tag>actionpack routing</tag>
      <title>default_url_options is being ignored by named route optimisation</title>
      <updated-at type="datetime">2008-08-30T02:18:51+01:00</updated-at>
      <user-id type="integer">85</user-id>
      <user-name>Jeremy Kemper</user-name>
      <creator-name>Deepak Jois</creator-name>
      <assigned-user-name>Michael Koziarski</assigned-user-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/22</url>
      <milestone-title>2.1.1</milestone-title>
    </version>
  </versions>
  <attachments type="array">
    <attachment type="Attachment">
      <code>9613af3bf28d1f24fcbd0df45f08b685be5cc404</code>
      <content-type>text/plain</content-type>
      <created-at type="datetime">2008-04-27T12:44:57+01:00</created-at>
      <filename>default_url_options_named_routes.patch</filename>
      <height type="integer" nil="true"></height>
      <id type="integer">20339</id>
      <size type="integer">4751</size>
      <uploader-id type="integer">586</uploader-id>
      <width type="integer" nil="true"></width>
      <url>http://rails.lighthouseapp.com/attachments/20339/default_url_options_named_routes.patch</url>
    </attachment>
    <attachment type="Attachment">
      <code>23b24ac4705d5e85eab6f5053c41b55e4df066b0</code>
      <content-type>text/plain</content-type>
      <created-at type="datetime">2008-05-04T16:59:39+01:00</created-at>
      <filename>fix_default_url_options_regression.diff</filename>
      <height type="integer" nil="true"></height>
      <id type="integer">21394</id>
      <size type="integer">3847</size>
      <uploader-id type="integer">586</uploader-id>
      <width type="integer" nil="true"></width>
      <url>http://rails.lighthouseapp.com/attachments/21394/fix_default_url_options_regression.diff</url>
    </attachment>
    <attachment type="Attachment">
      <code>f6a72538d7174f7796ff6a81d0f1d9c2c6488698</code>
      <content-type>text/plain</content-type>
      <created-at type="datetime">2008-05-04T17:23:04+01:00</created-at>
      <filename>ticket22_bug.diff</filename>
      <height type="integer" nil="true"></height>
      <id type="integer">21396</id>
      <size type="integer">782</size>
      <uploader-id type="integer">1023</uploader-id>
      <width type="integer" nil="true"></width>
      <url>http://rails.lighthouseapp.com/attachments/21396/ticket22_bug.diff</url>
    </attachment>
  </attachments>
</ticket>
