José Valim
2008-Jul-29 20:46 UTC
dispatcher should only be loaded if ActionController is defined
I was trying to create an environment where only ActiveRecord and ActionMailer were loaded but it failed on the last step. The dispatcher is loaded even if ActionController is not defined. To fix it I just needed to add the line below to railties/lib/ initializer.rb, on the prepare_dispatcher method, around line 480: return unless configuration.frameworks.include?(:action_controller) So we have: def prepare_dispatcher return unless configuration.frameworks.include?(:action_controller) require ''dispatcher'' unless defined?(::Dispatcher) Dispatcher.define_dispatcher_callbacks(configuration.cache_classes) Dispatcher.new(RAILS_DEFAULT_LOGGER).send :run_callbacks, :prepare_dispatch end Ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/721-dispatcher-should-only-be-loaded-if-actioncontroller-is-defined --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---