mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Use default_url_options from parent_controller
Use a configured Devise.parent_controller, not ApplicationController Also remove passing `*args` since it's a class-level attribute, not a method.
This commit is contained in:
parent
359fba970e
commit
8aa0e2655e
1 changed files with 5 additions and 2 deletions
|
@ -22,9 +22,12 @@ module Devise
|
|||
@respond.call(env)
|
||||
end
|
||||
|
||||
# Try retrieving the URL options from the parent controller (usually
|
||||
# ApplicationController). Instance methods are not supported at the moment,
|
||||
# so only the class-level attribute is used.
|
||||
def self.default_url_options(*args)
|
||||
if defined?(ApplicationController)
|
||||
ApplicationController.default_url_options(*args)
|
||||
if defined?(Devise.parent_controller.constantize)
|
||||
Devise.parent_controller.constantize.try(:default_url_options) || {}
|
||||
else
|
||||
{}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue