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

Detail loading process.

This commit is contained in:
José Valim 2009-10-21 00:12:21 -02:00
parent f00d29c97a
commit a7e25f1b39
3 changed files with 20 additions and 23 deletions

View file

@ -1,9 +1,2 @@
# We need to load devise here to ensure routes extensions are loaded.
require 'devise'
# Configures a preparation callback to include devise authenticable module and
# view helpers (engines don't load helpers by default)
#config.to_prepare do
# ActionController::Base.send :include, Devise::Controllers::Authenticable
# ActionView::Base.send :include, DeviseHelper
## ApplicationController.helper(DeviseHelper)
#end

View file

@ -1,10 +1,3 @@
begin
require 'warden'
rescue
gem 'warden'
require 'warden'
end
module Devise
ALL = [:authenticable, :confirmable, :recoverable, :rememberable, :validatable].freeze
@ -38,13 +31,18 @@ module Devise
end
end
require 'devise/warden'
require 'devise/routes'
# Ensure to include Devise modules only after Rails initialization.
# This way application should have already defined Devise mappings and we are
# able to create default filters.
# Devise initialization process goes like this:
#
# 1) Include Devise::ActiveRecord and Devise::Migrations
# 2) Load and config warden
# 3) Add routes extensions
# 4) Load routes definitions
# 5) Include filters and helpers in controllers and views
#
Rails.configuration.after_initialize do
ActiveRecord::Base.extend Devise::ActiveRecord
ActiveRecord::ConnectionAdapters::TableDefinition.send :include, Devise::Migrations
end
require 'devise/warden'
require 'devise/routes'

View file

@ -1,5 +1,11 @@
# Taken from RailsWarden, thanks to Hassox.
# http://github.com/hassox/rails_warden
begin
require 'warden'
rescue
gem 'warden'
require 'warden'
end
# Taken from RailsWarden, thanks to Hassox. http://github.com/hassox/rails_warden
module Warden::Mixins::Common
# Gets the rails request object by default if it's available
def request