mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Remove deprecation warnings on Rails 3.1.
This commit is contained in:
parent
721843c841
commit
94ccfc5322
1 changed files with 4 additions and 3 deletions
|
@ -7,8 +7,9 @@ module Devise
|
|||
|
||||
# Skip eager load of controllers because it is handled by Devise
|
||||
# to avoid loading unused controllers.
|
||||
config.paths.app.controllers.autoload!
|
||||
config.paths.app.controllers.skip_eager_load!
|
||||
target = paths.is_a?(Hash) ? paths["app/controllers"] : paths.app.controllers
|
||||
target.autoload!
|
||||
target.skip_eager_load!
|
||||
|
||||
# Initialize Warden and copy its configurations.
|
||||
config.app_middleware.use Warden::Manager do |config|
|
||||
|
@ -54,7 +55,7 @@ module Devise
|
|||
def eager_load!
|
||||
mappings = Devise.mappings.values.map(&:modules).flatten.uniq
|
||||
controllers = Devise::CONTROLLERS.values_at(*mappings)
|
||||
path = paths.app.controllers.to_a.first
|
||||
path = paths.is_a?(Hash) ? paths["app/controllers"].first : paths.app.controllers.first
|
||||
matcher = /\A#{Regexp.escape(path)}\/(.*)\.rb\Z/
|
||||
|
||||
Dir.glob("#{path}/devise/{#{controllers.join(',')}}_controller.rb").sort.each do |file|
|
||||
|
|
Loading…
Add table
Reference in a new issue