1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fixed problems with dependency caching and controller hierarchies on Ruby 1.8.2 in development mode #351

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@317 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-01-02 18:32:56 +00:00
parent 569f2ea85b
commit 375568b7cb
3 changed files with 12 additions and 4 deletions

View file

@ -1,5 +1,7 @@
*SVN* *SVN*
* Fixed problems with dependency caching and controller hierarchies on Ruby 1.8.2 in development mode #351
* Added automated rewriting of the shebang lines on installs through the gem rails command #379 [Manfred Stienstra] * Added automated rewriting of the shebang lines on installs through the gem rails command #379 [Manfred Stienstra]
* Fixed that generated action_mailers doesnt need to require the action_mailer since thats already done in the environment #382 [Lucas Carlson] * Fixed that generated action_mailers doesnt need to require the action_mailer since thats already done in the environment #382 [Lucas Carlson]

View file

@ -233,7 +233,7 @@ spec = Gem::Specification.new do |s|
on top of either MySQL, PostgreSQL, or SQLite with eRuby-based templates. on top of either MySQL, PostgreSQL, or SQLite with eRuby-based templates.
EOF EOF
s.add_dependency('rake', '>= 0.4.11') s.add_dependency('rake', '>= 0.4.14')
s.add_dependency('activerecord', '>= 1.3.0') s.add_dependency('activerecord', '>= 1.3.0')
s.add_dependency('actionpack', '>= 1.1.0') s.add_dependency('actionpack', '>= 1.1.0')
s.add_dependency('actionmailer', '>= 0.5.0') s.add_dependency('actionmailer', '>= 0.5.0')

View file

@ -41,10 +41,9 @@ class Dispatcher
ActionController::Base.process_with_exception(request, response, exception).out ActionController::Base.process_with_exception(request, response, exception).out
ensure ensure
if Dependencies.mechanism == :load if Dependencies.mechanism == :load
Object.send(:remove_const, "ApplicationController") if Object.const_defined?(:ApplicationController) remove_class_hierarchy(controller_class(controller_name), ActionController::Base)
Object.send(:remove_const, controller_class_name(controller_name)) if Object.const_defined?(controller_class_name(controller_name))
ActiveRecord::Base.reset_column_information_and_inheritable_attributes_for_all_subclasses ActiveRecord::Base.reset_column_information_and_inheritable_attributes_for_all_subclasses
Dependencies.reload Dependencies.reload rescue nil # Ignore out of order reloading errors for Controllers
end end
Breakpoint.deactivate_drb if defined?(BREAKPOINT_SERVER_PORT) Breakpoint.deactivate_drb if defined?(BREAKPOINT_SERVER_PORT)
@ -74,4 +73,11 @@ class Dispatcher
def self.module_name(parameters) def self.module_name(parameters)
parameters["module"].gsub(/[^_a-zA-Z0-9]/, "").untaint if parameters["module"] parameters["module"].gsub(/[^_a-zA-Z0-9]/, "").untaint if parameters["module"]
end end
def self.remove_class_hierarchy(klass, until_superclass)
while klass
Object.send(:remove_const, "#{klass}".intern)
klass = (klass.superclass unless until_superclass == klass.superclass)
end
end
end end