Skip to content

Commit

Permalink
Merge git://github.com/seriph/thin into seriph
Browse files Browse the repository at this point in the history
* git://github.com/seriph/thin:
  Support new Rails 2.1.1 method of setting relative_url_root as well as older Rails via a respond_to? check
  Rails now uses ActionController::Base.relative_url_root to set relative_url_root.
  • Loading branch information
macournoyer committed Oct 22, 2008
2 parents 3cddf37 + b6b0d84 commit 39f3f73
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/rack/adapter/rails.rb
Expand Up @@ -31,7 +31,13 @@ def load_application
require "#{@root}/config/environment"
require 'dispatcher'

ActionController::AbstractRequest.relative_url_root = @prefix if @prefix
if @prefix
if ActionController::Base.respond_to?('relative_url_root=')
ActionController::Base.relative_url_root = @prefix # Rails 2.1.1
else
ActionController::AbstractRequest.relative_url_root = @prefix
end
end
end

# TODO refactor this in File#can_serve?(path) ??
Expand Down

0 comments on commit 39f3f73

Please sign in to comment.