-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show a deprecation message for legacy routes
- Loading branch information
Showing
7 changed files
with
68 additions
and
20 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
app/controllers/solidus_auth_devise/controller_helpers/deprecated_routes.rb
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,36 @@ | ||
# frozen_string_literal: true | ||
|
||
module SolidusAuthDevise | ||
module ControllerHelpers | ||
module DeprecatedRoutes | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
before_action :deprecates_solidus_auth_devise_routes | ||
end | ||
|
||
private | ||
|
||
def deprecates_solidus_auth_devise_routes | ||
if params[:deprecated_route] | ||
Spree::Deprecation.warn( | ||
<<~TEXT | ||
This route is deprecated: #{request.fullpath.inspect}. | ||
It will be removed in solidus_auth_devise v3. | ||
If you want to continue using this route please define it in your application code: | ||
Spree::Core::Engine.routes.draw do | ||
devise_scope :spree_user do | ||
#{request.method.downcase} #{request.fullpath.inspect}, to: #{controller_path}##{action_name}, ... | ||
end | ||
end | ||
Please check your application for places in which this route was generated. | ||
TEXT | ||
) | ||
end | ||
end | ||
end | ||
end | ||
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
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
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
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