1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Use autoload to pre-load components (so they still work when rubygems are disabled)

This commit is contained in:
Dimitrij Denissenko 2009-12-02 02:35:46 +08:00 committed by José Valim
parent 153cc759ae
commit c711a9d1b5
3 changed files with 22 additions and 0 deletions

View file

@ -1,4 +1,8 @@
module Devise
autoload :Schema, 'devise/schema'
autoload :Mapping, 'devise/mapping'
autoload :FailureApp, 'devise/failure_app'
ALL = [:authenticatable, :confirmable, :recoverable, :rememberable,
:timeoutable, :trackable, :validatable].freeze
@ -144,6 +148,8 @@ end
# Set the default_scope to nil, so it's overwritten when the first route is declared.
Warden::Manager.default_scope = nil
require 'devise/controllers'
require 'devise/encryptors'
require 'devise/strategies/base'
require 'devise/serializers/base'
require 'devise/rails'

View file

@ -0,0 +1,7 @@
module Devise
module Controllers
autoload :Filters, 'devise/controllers/filters'
autoload :Helpers, 'devise/controllers/helpers'
autoload :UrlHelpers, 'devise/controllers/url_helpers'
end
end

9
lib/devise/encryptors.rb Normal file
View file

@ -0,0 +1,9 @@
module Devise
module Encryptors
autoload :AuthlogicSha512, 'devise/encryptors/authlogic_sha512'
autoload :AuthlogicSha1, 'devise/encryptors/authlogic_sha1'
autoload :RestfulAuthenticationSha1, 'devise/encryptors/restful_authentication_sha1'
autoload :Sha512, 'devise/encryptors/sha512'
autoload :Sha1, 'devise/encryptors/sha1'
end
end