mirror of
https://github.com/heartcombo/devise.git
synced 2026-04-28 03:00:29 -04:00
Extract routing context to its own file.
This commit is contained in:
@@ -1,12 +1,4 @@
|
||||
module Devise
|
||||
class RoutingDetails
|
||||
attr_reader :scope, :router_name
|
||||
|
||||
def initialize(mapping)
|
||||
@scope = mapping.name
|
||||
@router_name = mapping.router_name
|
||||
end
|
||||
end
|
||||
# Responsible for handling devise mappings and routes configuration. Each
|
||||
# resource configured by devise_for in routes is actually creating a mapping
|
||||
# object. You can refer to devise_for in routes for usage options.
|
||||
|
||||
12
lib/devise/routing_details.rb
Normal file
12
lib/devise/routing_details.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
module Devise
|
||||
# This is a data transfer object to avoid coupling between
|
||||
# Devive::Mapping and the rest of the application.
|
||||
class RoutingDetails
|
||||
attr_reader :scope, :router_name
|
||||
|
||||
def initialize(mapping)
|
||||
@scope = mapping.name
|
||||
@router_name = mapping.router_name
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user