From c2997017f79321a8d90af84b1de35f87e3dd2445 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Mon, 16 Nov 2009 13:58:08 -0800 Subject: Make script/server work with correct application.rb --- railties/lib/rails/application.rb | 5 +++++ railties/lib/rails/commands/server.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 10cba8ab6c..7c2d8eab67 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -3,6 +3,11 @@ module Rails include Initializable class << self + def inherited(klass) + Rails.application ||= klass unless klass.name =~ /Rails/ + super + end + # Stub out App initialize def initialize! new diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb index 37dfa3b9bb..2c90851fb2 100644 --- a/railties/lib/rails/commands/server.rb +++ b/railties/lib/rails/commands/server.rb @@ -42,7 +42,7 @@ unless server end puts "=> Booting #{ActiveSupport::Inflector.demodulize(server)}" -puts "=> Rails #{Rails.version} application starting on http://#{options[:Host]}:#{options[:Port]}}" +puts "=> Rails #{Rails.version} application starting on http://#{options[:Host]}:#{options[:Port]}" if options[:detach] Process.daemon -- cgit v1.2.3