```ruby
require 'action_dispatch/routing/mapper'

module ActionDispatch::Routing
  class Mapper
    protected
  
    def devise_cas(mapping, controllers)
      # service endpoint for CAS server
      get mapping.full_path, :to => "#{controllers[:cas_sessions]}#service"
      
      scope mapping.full_path do
        get mapping.path_names[:sign_in], :to => "#{controllers[:cas_sessions]}#create", :as => :"new_#{mapping.name}_session"
        post mapping.path_names[:sign_in], :to => "#{controllers[:cas_sessions]}#create", :as => :"#{mapping.name}_session"
        get mapping.path_names[:sign_out], :to => "#{controllers[:cas_sessions]}#destroy", :as => :"destroy_#{mapping.name}_session"
      end
    end
  end
end```

Use newer Devise API for fullpath
user
```ruby
require 'action_dispatch/routing/mapper'

module ActionDispatch::Routing
  class Mapper
    protected
  
    def devise_cas(mapping, controllers)
      # service endpoint for CAS server
      get mapping.fullpath, :to => "#{controllers[:cas_sessions]}#service"
      
      scope mapping.fullpath do
        get mapping.path_names[:sign_in], :to => "#{controllers[:cas_sessions]}#create", :as => :"new_#{mapping.name}_session"
        post mapping.path_names[:sign_in], :to => "#{controllers[:cas_sessions]}#create", :as => :"#{mapping.name}_session"
        get mapping.path_names[:sign_out], :to => "#{controllers[:cas_sessions]}#destroy", :as => :"destroy_#{mapping.name}_session"
      end
    end
  end
end
```
assistant