Permalink
Browse files

ActionController doesn't exists anymore in rails 3

  • Loading branch information...
1 parent d7a1d60 commit 5d055e0633b1e2ef3b90221b0c07e18f0f3202a3 Damien Mathieu committed with Apr 15, 2010
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/http_accept_language.rb
@@ -55,10 +55,10 @@ def compatible_language_from(array)
end
end
-if defined?(ActionController::Request)
- ActionController::Request.send :include, HttpAcceptLanguage
-elsif defined?(ActionController::AbstractRequest)
- ActionController::AbstractRequest.send :include, HttpAcceptLanguage
-elsif defined?(ActionController::CgiRequest)
- ActionController::CgiRequest.send :include, HttpAcceptLanguage
+if defined?(ActionDispatch::Request)
+ ActionDispatch::Request.send :include, HttpAcceptLanguage
+elsif defined?(ActionDispatch::AbstractRequest)
+ ActionDispatch::AbstractRequest.send :include, HttpAcceptLanguage
+elsif defined?(ActionDispatch::CgiRequest)
+ ActionDispatch::CgiRequest.send :include, HttpAcceptLanguage
end

3 comments on commit 5d055e0

But ActionController still exists in Rails 2.3.5
I think plugin should be backward compatible.

Rails 2.3.5 will soon be deprecated. If you wish to keep using it you can always use the version 1.0.1 which is the current gem published on gemcutter.

Owner

iain replied Jun 15, 2010

I'm thinking http_accept_language should be rack middleware, and some mixinable methods, thus eliminating this mess of duck punching.

Please sign in to comment.