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:
parent
f00d29c97a
commit
a7e25f1b39
3 changed files with 20 additions and 23 deletions
9
init.rb
9
init.rb
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue