List Info

Thread: changes to routing intentional




changes to routing intentional
country flaguser name
United States
2007-10-22 12:42:25
Hi,

    I've done a bit of googling and trac searching already
for this,
so apologies if this is already discussed or documented...

I found a change that blew up a bunch of code for me.  NOt
sure if I
was doing the wrong thing, so here it is.  Basically, in
2.0.0 PR the
generate method in
actionpack/lib/action_controller/routing.rb no
longer converts symbols passed in through
options[:controller] to
strings before running this code (1335 of routing.rb):

if !named_route && expire_on[:controller] &&
options[:controller] &&
options[:controller][0] != ?/

The last condition causes problems if the controller is
passed in as a
symbol.

I've fixed my code, but I was curious if this is an
intentional change
and if someone could point me to why?  I realize internally
it makes
strings anyway, so it doesn't save anything in terms of
memory, so
maybe that's a good enough reason.

Thanks,

Sujal


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-coregooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: changes to routing intentional
country flaguser name
Estonia
2007-10-22 15:54:20
http://dev.rub
yonrails.org/ticket/8562

On E, 2007-10-22 at 17:42 +0000, codesujal wrote:
> Hi,
> 
>     I've done a bit of googling and trac searching
already for this,
> so apologies if this is already discussed or
documented...
> 
> I found a change that blew up a bunch of code for me. 
NOt sure if I
> was doing the wrong thing, so here it is.  Basically,
in 2.0.0 PR the
> generate method in
actionpack/lib/action_controller/routing.rb no
> longer converts symbols passed in through
options[:controller] to
> strings before running this code (1335 of routing.rb):
> 
> if !named_route && expire_on[:controller]
&& options[:controller] &&
> options[:controller][0] != ?/
> 
> The last condition causes problems if the controller is
passed in as a
> symbol.
> 
> I've fixed my code, but I was curious if this is an
intentional change
> and if someone could point me to why?  I realize
internally it makes
> strings anyway, so it doesn't save anything in terms of
memory, so
> maybe that's a good enough reason.
> 
> Thanks,
> 
> Sujal
> 
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-coregooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )