heartcombo--devise/lib/devise/path_checker.rb

19 lines
430 B
Ruby
Raw Normal View History

module Devise
class PathChecker
include Rails.application.routes.url_helpers
2010-06-13 10:40:40 +00:00
def self.default_url_options(*args)
ApplicationController.default_url_options(*args)
end
def initialize(env, scope)
2010-07-06 12:58:40 +00:00
@current_path = "/#{env["SCRIPT_NAME"]}/#{env["PATH_INFO"]}".squeeze("/")
@scope = scope
end
def signing_out?
2010-07-06 12:58:40 +00:00
@current_path == send("destroy_#{@scope}_session_path")
end
end
end