First - apologies if the core group is an inappropriate place to repost this. I''m still looking for a definitive answer, and I''m hoping you might help. --- I''ve been diligently looking for a complete answer to the following question, but I haven''t seen any real resolution to it. Anyone have any new news? Problem: After associating an authentication method of the Application controller with before_filter throughout the application, I will occasionally get this error: A copy of ApplicationController has been removed from the module tree but is still active! This did not happen prior to my upgrade to 1.2. The workaround I''m using is to force Rails not to dynamically load/ unload the app''s controllers, i.e. in environment.rb: ## chasing update to 1.2 error... config.load_once_paths += %W{ #{RAILS_ROOT}/app/controllers } That keeps the error at bay, but I have to restart the server anytime I make a change during development, which is a royal pain in the patootie and something that negates one of the best characteristics of Rails. --- I''ve also read that this issue only crops up in development mode. Still, it seems like there''s gotta be a resolution somewhere...this isn''t designed behavior, is it? Thanks for any help, - David --~--~---------~--~----~------------~-------~--~----~ 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-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Mislav Marohnić
2007-Jun-21 18:16 UTC
Re: 1.2 upgrade problem -- controller auto loading?
On 6/21/07, David L Bean <vonbitski@gmail.com> wrote:> > > I''ve also read that this issue only crops up in development mode. > Still, it seems like there''s gotta be a resolution somewhere...this > isn''t designed behavior, is it?Well, it''s somewhat designed. I lost many many hours on this one (long time ago). After some research, it turned out that this was happening: I had a plugin controller in myplugin/lib directory. That controller inherited from the ApplicationController. Now, the way dependencies work is that they unload stuff in development mode in certain directories like app/controllers, but *not* anyplugin/lib. So, ApplicationController would get unloaded, but not my controller that inherited from it. This made Dependencies choke, and it was exactly triggered by a before_filter in my case also! --~--~---------~--~----~------------~-------~--~----~ 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-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---