1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Bring back behavior for < 3.0.4.

This commit is contained in:
José Valim 2011-02-16 20:59:58 +01:00
parent 0c5acc6f38
commit 7113beac81

View file

@ -128,8 +128,16 @@ module Devise
session["#{scope}_return_to"] = attempted_path if request.get? && !http_auth?
end
MIME_REFERENCES = Mime::HTML.respond_to?(:ref)
def request_format
@request_format ||= request.format.respond_to?(:ref) ? request.format.ref : request.format
@request_format ||= if request.format.respond_to?(:ref)
request.format.ref
elsif MIME_REFERENCES
request.format
else # Rails < 3.0.4
request.format.to_sym
end
end
end
end