diff --git a/railties/lib/rails/generators/named_base.rb b/railties/lib/rails/generators/named_base.rb index a1d39987e4..3632d820ee 100644 --- a/railties/lib/rails/generators/named_base.rb +++ b/railties/lib/rails/generators/named_base.rb @@ -46,7 +46,7 @@ module Rails def namespace @namespace ||= if defined?(Rails) && Rails.application - Rails.application.parents.detect { |n| n.respond_to?(:_railtie) } + Rails.application.class.parents.detect { |n| n.respond_to?(:_railtie) } end end diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb index 45cf565e86..8b38081667 100644 --- a/railties/test/abstract_unit.rb +++ b/railties/test/abstract_unit.rb @@ -16,5 +16,3 @@ module TestApp config.root = File.dirname(__FILE__) end end - -Rails.application = TestApp::Application