Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix compatibility with Rails edge, in which application.rb was rename…

…d to application_controller.rb.
  • Loading branch information...
commit 1301af69f5bb8b050dc888566b0c9aa52419ccb1 1 parent 4599027
@FooBarWidget FooBarWidget authored
View
6 lib/passenger/railz/application_spawner.rb
@@ -261,7 +261,11 @@ def load_environment_with_passenger
if !defined?(Dispatcher)
require 'dispatcher'
end
- require_dependency 'application'
+ if File.exist?('app/controllers/application_controller.rb')
+ require_dependency 'application_controller'
+ else
+ require_dependency 'application'
+ end
if GC.copy_on_write_friendly?
Dir.glob('app/{models,controllers,helpers}/*.rb').each do |file|
require_dependency normalize_path(file)
View
8 test/ruby/rails/minimal_spawner_spec.rb
@@ -34,4 +34,12 @@
environment.should == "development"
end
end
+
+ it "loads application_controller.rb instead of application.rb, if the former exists" do
+ use_rails_stub('foobar') do |stub|
+ File.rename("#{stub.app_root}/app/controllers/application.rb",
+ "#{stub.app_root}/app/controllers/application_controller.rb")
+ lambda { spawn_stub_application(stub).close }.should_not raise_error
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.