peter-iyPFG2wf9H7QT0dZR+AlfA@public.gmane.org
2007-Sep-21 10:24 UTC
Trouble with controller caching
Hi All! I have an application with a frontend and admin backend. In both sections there are controllers with the same name (e.g. CampaignsController and Admin::CampaignsController). The front and backend controllers have seperate authentification methods (for users and admins). When a admin browses to admin -> campaigns they are redirected to the frontend login screen as if they had browsed to the frontend campaigns controller. The problem is solved when product.rb -> config.cache_classes is set to false OR when all the admincontroller names are prefixed with ''Admin'' (e.g. Admin::AdminCampaign). Is there any other way I can get around this? has anyone else experienced this problem? Many Thanks, Peter --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Did you try this in edge rails ? On 9/21/07, peter-iyPFG2wf9H7QT0dZR+AlfA@public.gmane.org <inneroptics-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi All! > > I have an application with a frontend and admin backend. In both > sections there are controllers with the same name (e.g. > CampaignsController and Admin::CampaignsController). The front and > backend controllers have seperate authentification methods (for users > and admins). When a admin browses to admin -> campaigns they are > redirected to the frontend login screen as if they had browsed to the > frontend campaigns controller. The problem is solved when product.rb - > > config.cache_classes is set to false OR when all the admin > controller names are prefixed with ''Admin'' (e.g. > Admin::AdminCampaign). Is there any other way I can get around this? > has anyone else experienced this problem? > > Many Thanks, > Peter > > > > >-- Cheers! - Pratik http://m.onkey.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pratik Naik wrote:> Did you try this in edge rails ?Indeed you should. Namespacing of controllers has been a pain in Rails <= 1.2 but Rails 2.0 does offer support for namespaced controllers. In config/routes.rb: map.namespace(:admin) do |admin| admin.resources :campaigns ... end -- Roderick van Domburg http://www.nedforce.com -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
peter-iyPFG2wf9H7QT0dZR+AlfA@public.gmane.org
2007-Sep-21 13:03 UTC
Re: Trouble with controller caching
Thanks for the quick replies. I thought before I tried edge rails that I would replicate the problem locally. So I''ve run the app using the production env and using mongrel instead of webrick, all the versions are the same yet the problem doesn''t appear. Any ideas? Peter On Sep 21, 12:00 pm, Roderick van Domburg <rails-mailing-l...@andreas- s.net> wrote:> Pratik Naik wrote: > > Did you try this in edge rails ? > > Indeed you should. Namespacing of controllers has been a pain in Rails > <= 1.2 but Rails 2.0 does offer support for namespaced controllers. In > config/routes.rb: > > map.namespace(:admin) do |admin| > admin.resources :campaigns > ... > end > > -- > Roderick van Domburghttp://www.nedforce.com > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
peter-iyPFG2wf9H7QT0dZR+AlfA@public.gmane.org
2007-Sep-21 13:23 UTC
Re: Trouble with controller caching
I''m also seeing this in my mongrel logs on the server: /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/inflector.rb:250: warning: toplevel constant CampaignsController referenced by Admin::CampaignsController Any ideas? Peter On Sep 21, 2:03 pm, "pe...-iyPFG2wf9H7QT0dZR+AlfA@public.gmane.org" <inneropt...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks for the quick replies. > > I thought before I tried edge rails that I would replicate the problem > locally. So I''ve run the app using the production env and using > mongrel instead of webrick, all the versions are the same yet the > problem doesn''t appear. Any ideas? > > Peter > > On Sep 21, 12:00 pm, Roderick van Domburg <rails-mailing-l...@andreas- > > s.net> wrote: > > Pratik Naik wrote: > > > Did you try this in edge rails ? > > > Indeed you should. Namespacing of controllers has been a pain in Rails > > <= 1.2 but Rails 2.0 does offer support for namespaced controllers. In > > config/routes.rb: > > > map.namespace(:admin) do |admin| > > admin.resources :campaigns > > ... > > end > > > -- > > Roderick van Domburghttp://www.nedforce.com > > -- > > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pastie your code On 9/21/07, peter-iyPFG2wf9H7QT0dZR+AlfA@public.gmane.org <inneroptics-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''m also seeing this in my mongrel logs on the server: > > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ > active_support/inflector.rb:250: warning: toplevel constant > CampaignsController referenced by Admin::CampaignsController > > Any ideas? > > Peter > > On Sep 21, 2:03 pm, "pe...-iyPFG2wf9H7QT0dZR+AlfA@public.gmane.org" <inneropt...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Thanks for the quick replies. > > > > I thought before I tried edge rails that I would replicate the problem > > locally. So I''ve run the app using the production env and using > > mongrel instead of webrick, all the versions are the same yet the > > problem doesn''t appear. Any ideas? > > > > Peter > > > > On Sep 21, 12:00 pm, Roderick van Domburg <rails-mailing-l...@andreas- > > > > s.net> wrote: > > > Pratik Naik wrote: > > > > Did you try this in edge rails ? > > > > > Indeed you should. Namespacing of controllers has been a pain in Rails > > > <= 1.2 but Rails 2.0 does offer support for namespaced controllers. In > > > config/routes.rb: > > > > > map.namespace(:admin) do |admin| > > > admin.resources :campaigns > > > ... > > > end > > > > > -- > > > Roderick van Domburghttp://www.nedforce.com > > > -- > > > Posted viahttp://www.ruby-forum.com/. > > > > >-- Cheers! - Pratik http://m.onkey.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Peter & all, Was a solution ever found for this? I''m running on Edge Rails (2.0 RC 1) and I''m encountering the same thing, only in production, and only intermittently. When mongrel has been running for "a while" I start to run into this same problem, where I have EventsController and Worker::EventsController. The latter doesn''t require authorization, but links to /worker/events start directing to /events, which in turn leads to a filter chain halt due to a lack of authorization. Even more oddly, if I access /worker/events/, I''m redirected properly to Worker::EventsController, but if I leave off the trailing /, I get bounced out. I''m seeing the following in my Mongrel Logs: /var/www/apps/workerlogic/releases/20071116212637/vendor/rails/ activerecord/lib/../../activesupport/lib/active_support/inflector.rb: 257: warning: toplevel constant EventsController referenced by Worker::EventsController Any thoughts would be appreciated! - Jared On Sep 21, 8:23 am, "pe...-iyPFG2wf9H7QT0dZR+AlfA@public.gmane.org" <inneropt...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m also seeing this in my mongrel logs on the server: > > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ > active_support/inflector.rb:250: warning: toplevel constant > CampaignsController referenced by Admin::CampaignsController > > Any ideas? > > Peter > > On Sep 21, 2:03 pm, "pe...-iyPFG2wf9H7QT0dZR+AlfA@public.gmane.org" <inneropt...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Thanks for the quick replies. > > > I thought before I tried edge rails that I would replicate the problem > > locally. So I''ve run the app using the production env and using > > mongrel instead of webrick, all the versions are the same yet the > > problem doesn''t appear. Any ideas? > > > Peter > > > On Sep 21, 12:00 pm, Roderick van Domburg <rails-mailing-l...@andreas- > > > s.net> wrote: > > > Pratik Naik wrote: > > > > Did you try this in edge rails ? > > > > Indeed you should. Namespacing of controllers has been a pain in Rails > > > <= 1.2 but Rails 2.0 does offer support for namespaced controllers. In > > > config/routes.rb: > > > > map.namespace(:admin) do |admin| > > > admin.resources :campaigns > > > ... > > > end > > > > -- > > > Roderick van Domburghttp://www.nedforce.com > > > -- > > > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
jack.dempsey-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Nov-25 22:14 UTC
Re: Trouble with controller caching
I''ve had the same happen to me; you''ve hit it on the head exactly with the "a while" type behavior. Its really perplexing, and I can''t think of what might be going on. The trailing slash thing doesn''t work for me either. I guess I can try the stuff mentioned earlier, but just wanted to at least chime in with a "yeah happens to me too" and hope we can figure this out... jack On Nov 19, 3:51 pm, Jared <jared.hawo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Peter & all, > > Was a solution ever found for this? I''m running on Edge Rails (2.0 RC > 1) and I''m encountering the same thing, only in production, and only > intermittently. > > When mongrel has been running for "a while" I start to run into this > same problem, where I have EventsController and > Worker::EventsController. The latter doesn''t require authorization, > but links to /worker/events start directing to /events, which in turn > leads to a filter chain halt due to a lack of authorization. > > Even more oddly, if I access /worker/events/, I''m redirected properly > to Worker::EventsController, but if I leave off the trailing /, I get > bounced out. > > I''m seeing the following in my Mongrel Logs: > > /var/www/apps/workerlogic/releases/20071116212637/vendor/rails/ > activerecord/lib/../../activesupport/lib/active_support/inflector.rb: > 257: warning: toplevel constant EventsController referenced by > Worker::EventsController > > Any thoughts would be appreciated! > > - Jared > > On Sep 21, 8:23 am, "pe...-iyPFG2wf9H7QT0dZR+AlfA@public.gmane.org" <inneropt...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''m also seeing this in my mongrel logs on the server: > > > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ > > active_support/inflector.rb:250: warning: toplevel constant > > CampaignsController referenced by Admin::CampaignsController > > > Any ideas? > > > Peter > > > On Sep 21, 2:03 pm, "pe...-iyPFG2wf9H7QT0dZR+AlfA@public.gmane.org" <inneropt...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Thanks for the quick replies. > > > > I thought before I tried edge rails that I would replicate the problem > > > locally. So I''ve run the app using the production env and using > > > mongrel instead of webrick, all the versions are the same yet the > > > problem doesn''t appear. Any ideas? > > > > Peter > > > > On Sep 21, 12:00 pm, Roderick van Domburg <rails-mailing-l...@andreas- > > > > s.net> wrote: > > > > Pratik Naik wrote: > > > > > Did you try this in edge rails ? > > > > > Indeed you should. Namespacing of controllers has been a pain in Rails > > > > <= 1.2 but Rails 2.0 does offer support for namespaced controllers. In > > > > config/routes.rb: > > > > > map.namespace(:admin) do |admin| > > > > admin.resources :campaigns > > > > ... > > > > end > > > > > -- > > > > Roderick van Domburghttp://www.nedforce.com > > > > -- > > > > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jack, While it''s not an answer, my best workaround was to move away from controllers that would have namespace conflicts, so my Worker::EventsController is now Worker::JobsController. I suspect the problem comes from having the controllers in different ''levels'' of namespace... EventsController was at the root, and Worker::EventsController was in a namespace. The problem seemed to come from the latter ''losing'' it''s namespace. Where, if I had them each in a namespace, I suspect I wouldn''t see the problem. So, maybe there''s something in Rails routing or in mongrel that''s asking for controller_name and not getting the module prepended on it? On Nov 25, 5:14 pm, "jack.demp...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <jack.demp...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve had the same happen to me; you''ve hit it on the head exactly with > the "a while" type behavior. Its really perplexing, and I can''t think > of what might be going on. > > The trailing slash thing doesn''t work for me either. I guess I can try > the stuff mentioned earlier, but just wanted to at least chime in with > a "yeah happens to me too" and hope we can figure this out... > > jack > > On Nov 19, 3:51 pm, Jared <jared.hawo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Peter & all, > > > Was a solution ever found for this? I''m running on Edge Rails (2.0 RC > > 1) and I''m encountering the same thing, only in production, and only > > intermittently. > > > When mongrel has been running for "a while" I start to run into this > > same problem, where I have EventsController and > > Worker::EventsController. The latter doesn''t require authorization, > > but links to /worker/events start directing to /events, which in turn > > leads to a filter chain halt due to a lack of authorization. > > > Even more oddly, if I access /worker/events/, I''m redirected properly > > to Worker::EventsController, but if I leave off the trailing /, I get > > bounced out. > > > I''m seeing the following in my Mongrel Logs: > > > /var/www/apps/workerlogic/releases/20071116212637/vendor/rails/ > > activerecord/lib/../../activesupport/lib/active_support/inflector.rb: > > 257: warning: toplevel constant EventsController referenced by > > Worker::EventsController > > > Any thoughts would be appreciated! > > > - Jared > > > On Sep 21, 8:23 am, "pe...-iyPFG2wf9H7QT0dZR+AlfA@public.gmane.org" <inneropt...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I''m also seeing this in my mongrel logs on the server: > > > > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ > > > active_support/inflector.rb:250: warning: toplevel constant > > > CampaignsController referenced by Admin::CampaignsController > > > > Any ideas? > > > > Peter > > > > On Sep 21, 2:03 pm, "pe...-iyPFG2wf9H7QT0dZR+AlfA@public.gmane.org" <inneropt...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Thanks for the quick replies. > > > > > I thought before I tried edge rails that I would replicate the problem > > > > locally. So I''ve run the app using the production env and using > > > > mongrel instead of webrick, all the versions are the same yet the > > > > problem doesn''t appear. Any ideas? > > > > > Peter > > > > > On Sep 21, 12:00 pm, Roderick van Domburg <rails-mailing-l...@andreas- > > > > > s.net> wrote: > > > > > Pratik Naik wrote: > > > > > > Did you try this in edge rails ? > > > > > > Indeed you should. Namespacing of controllers has been a pain in Rails > > > > > <= 1.2 but Rails 2.0 does offer support for namespaced controllers. In > > > > > config/routes.rb: > > > > > > map.namespace(:admin) do |admin| > > > > > admin.resources :campaigns > > > > > ... > > > > > end > > > > > > -- > > > > > Roderick van Domburghttp://www.nedforce.com > > > > > -- > > > > > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Continuing my own thought, a quick look at the controller_path() class method in Rails 2.0 RC1 reveals this: in action_pack/lib/action_controller/base.rb: class <<self def controller_path @controller_path ||= name.gsub(/Controller$/, '''').underscore end end I wonder if there''s a caching issue where that @controller_path ||= is concerned? On Nov 28, 3:26 pm, Jared <jared.hawo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Jack, > > While it''s not an answer, my best workaround was to move away from > controllers that would have namespace conflicts, so my > Worker::EventsController is now Worker::JobsController. > > I suspect the problem comes from having the controllers in different > ''levels'' of namespace... EventsController was at the root, and > Worker::EventsController was in a namespace. The problem seemed to > come from the latter ''losing'' it''s namespace. Where, if I had them > each in a namespace, I suspect I wouldn''t see the problem. So, maybe > there''s something in Rails routing or in mongrel that''s asking for > controller_name and not getting the module prepended on it? > > On Nov 25, 5:14 pm, "jack.demp...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <jack.demp...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > I''ve had the same happen to me; you''ve hit it on the head exactly with > > the "a while" type behavior. Its really perplexing, and I can''t think > > of what might be going on. > > > The trailing slash thing doesn''t work for me either. I guess I can try > > the stuff mentioned earlier, but just wanted to at least chime in with > > a "yeah happens to me too" and hope we can figure this out... > > > jack > > > On Nov 19, 3:51 pm, Jared <jared.hawo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Peter & all, > > > > Was a solution ever found for this? I''m running on Edge Rails (2.0 RC > > > 1) and I''m encountering the same thing, only in production, and only > > > intermittently. > > > > When mongrel has been running for "a while" I start to run into this > > > same problem, where I have EventsController and > > > Worker::EventsController. The latter doesn''t require authorization, > > > but links to /worker/events start directing to /events, which in turn > > > leads to a filter chain halt due to a lack of authorization. > > > > Even more oddly, if I access /worker/events/, I''m redirected properly > > > to Worker::EventsController, but if I leave off the trailing /, I get > > > bounced out. > > > > I''m seeing the following in my Mongrel Logs: > > > > /var/www/apps/workerlogic/releases/20071116212637/vendor/rails/ > > > activerecord/lib/../../activesupport/lib/active_support/inflector.rb: > > > 257: warning: toplevel constant EventsController referenced by > > > Worker::EventsController > > > > Any thoughts would be appreciated! > > > > - Jared > > > > On Sep 21, 8:23 am, "pe...-iyPFG2wf9H7QT0dZR+AlfA@public.gmane.org" <inneropt...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I''m also seeing this in my mongrel logs on the server: > > > > > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ > > > > active_support/inflector.rb:250: warning: toplevel constant > > > > CampaignsController referenced by Admin::CampaignsController > > > > > Any ideas? > > > > > Peter > > > > > On Sep 21, 2:03 pm, "pe...-iyPFG2wf9H7QT0dZR+AlfA@public.gmane.org" <inneropt...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Thanks for the quick replies. > > > > > > I thought before I tried edge rails that I would replicate the problem > > > > > locally. So I''ve run the app using the production env and using > > > > > mongrel instead of webrick, all the versions are the same yet the > > > > > problem doesn''t appear. Any ideas? > > > > > > Peter > > > > > > On Sep 21, 12:00 pm, Roderick van Domburg <rails-mailing-l...@andreas- > > > > > > s.net> wrote: > > > > > > Pratik Naik wrote: > > > > > > > Did you try this in edge rails ? > > > > > > > Indeed you should. Namespacing of controllers has been a pain in Rails > > > > > > <= 1.2 but Rails 2.0 does offer support for namespaced controllers. In > > > > > > config/routes.rb: > > > > > > > map.namespace(:admin) do |admin| > > > > > > admin.resources :campaigns > > > > > > ... > > > > > > end > > > > > > > -- > > > > > > Roderick van Domburghttp://www.nedforce.com > > > > > > -- > > > > > > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jared wrote:> Continuing my own thought, a quick look at the controller_path() class > method in Rails 2.0 RC1 reveals this: > > in action_pack/lib/action_controller/base.rb: > > class <<self > def controller_path > @controller_path ||= name.gsub(/Controller$/, '''').underscore > end > end > > I wonder if there''s a caching issue where that @controller_path ||= is > concerned?Oh, I bet you''re right. I"m getting bit by the same issue right now. I have two types of namespaced controller: admin and school. The admin namespace has no issues, but the school namespaced controllers completely blow up _only_ when running "rake test:functionals", not when running their tests by themselves. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Did anybody learn anything new about this issue? I''m still having issues with Rails 2.0.2 and I''m kind of lost on what the cause is. On Dec 9 2007, 8:33 pm, James Herdman <rails-mailing-l...@andreas- s.net> wrote:> Jared wrote: > > Continuing my own thought, a quick look at the controller_path() class > > method in Rails 2.0 RC1 reveals this: > > > in action_pack/lib/action_controller/base.rb: > > > class <<self > > def controller_path > > @controller_path ||= name.gsub(/Controller$/, '''').underscore > > end > > end > > > I wonder if there''s a caching issue where that @controller_path ||= is > > concerned? > > Oh, I bet you''re right. I"m getting bit by the same issue right now. I > have two types of namespaced controller: admin and school. The admin > namespace has no issues, but the school namespaced controllers > completely blow up _only_ when running "rake test:functionals", not when > running their tests by themselves. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thijs Cadier wrote:> Did anybody learn anything new about this issue? I''m still having > issues with Rails 2.0.2 and I''m kind of lost on what the cause is. > > > On Dec 9 2007, 8:33 pm, James Herdman <rails-mailing-l...@andreas-I''m also getting this problem with Rails 2.0.2. I''ve noticed that I can make the problem go away by turning off cache_classes in the configuration. config.cache_classes = false With it on My controllers Admin::PageController & PageController often get muddled causing all my tests to explode :( I guess that leans further towards this being an issue of caching and not respecting namespaces... -- Joseph Wilk http://www.joesniff.co.uk -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
This link was helpful for me: http://peat.wordpress.com/2006/06/30/watch-your-namespace/ Do you also have a model with the same name as your namespace? I did. Seems like this should have been fixed by rails 2.0.2, but it looks like it''s happening again -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---