forked from jkraemer/clearance
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move routes loading to separate file
Signed-off-by: Dan Croak <dcroak@thoughtbot.com>
- Loading branch information
Joshua Clayton
authored and
Dan Croak
committed
May 31, 2009
1 parent
3149ffc
commit 32498de
Showing
3 changed files
with
14 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,6 @@ | ||
require 'clearance/extensions/errors' | ||
require 'clearance/extensions/rescue' | ||
require 'clearance/extensions/routes' | ||
|
||
require 'clearance/authentication' | ||
require 'clearance/user' | ||
|
||
class ActionController::Routing::RouteSet | ||
def load_routes_with_clearance! | ||
lib_path = File.dirname(__FILE__) | ||
clearance_routes = File.join(lib_path, *%w[.. config clearance_routes.rb]) | ||
unless configuration_files.include?(clearance_routes) | ||
add_configuration_file(clearance_routes) | ||
end | ||
load_routes_without_clearance! | ||
end | ||
|
||
alias_method_chain :load_routes!, :clearance | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class ActionController::Routing::RouteSet | ||
def load_routes_with_clearance! | ||
lib_path = File.dirname(__FILE__) | ||
clearance_routes = File.join(lib_path, *%w[.. .. .. config clearance_routes.rb]) | ||
unless configuration_files.include?(clearance_routes) | ||
add_configuration_file(clearance_routes) | ||
end | ||
load_routes_without_clearance! | ||
end | ||
|
||
alias_method_chain :load_routes!, :clearance | ||
end |