2009-10-18 15:30:32 +00:00
|
|
|
module Devise
|
2009-10-30 10:29:10 +00:00
|
|
|
ALL = [:authenticatable, :confirmable, :recoverable, :rememberable, :validatable].freeze
|
2009-10-18 15:30:32 +00:00
|
|
|
|
|
|
|
# Maps controller names to devise modules
|
|
|
|
CONTROLLERS = {
|
2009-10-30 10:29:10 +00:00
|
|
|
:sessions => :authenticatable,
|
2009-10-18 15:30:32 +00:00
|
|
|
:passwords => :recoverable,
|
|
|
|
:confirmations => :confirmable
|
|
|
|
}.freeze
|
2009-10-20 10:44:21 +00:00
|
|
|
|
|
|
|
TRUE_VALUES = [true, 1, '1', 't', 'T', 'true', 'TRUE'].freeze
|
2009-10-18 15:30:32 +00:00
|
|
|
end
|
|
|
|
|
2009-10-21 02:12:21 +00:00
|
|
|
# Devise initialization process goes like this:
|
|
|
|
#
|
2009-10-30 23:51:50 +00:00
|
|
|
# 1) Includes in Devise::ActiveRecord and Devise::Migrations
|
2009-10-21 02:12:21 +00:00
|
|
|
# 2) Load and config warden
|
2009-10-23 12:13:23 +00:00
|
|
|
# 3) Load devise mapping structure
|
|
|
|
# 4) Add routes extensions
|
|
|
|
# 5) Load routes definitions
|
|
|
|
# 6) Include filters and helpers in controllers and views
|
2009-10-21 02:12:21 +00:00
|
|
|
#
|
2009-10-11 11:15:48 +00:00
|
|
|
Rails.configuration.after_initialize do
|
2009-10-30 23:51:50 +00:00
|
|
|
if defined?(ActiveRecord)
|
|
|
|
ActiveRecord::Base.extend Devise::Models
|
|
|
|
ActiveRecord::ConnectionAdapters::TableDefinition.send :include, Devise::Migrations
|
|
|
|
end
|
|
|
|
|
2009-10-30 09:33:55 +00:00
|
|
|
I18n.load_path.unshift File.expand_path(File.join(File.dirname(__FILE__), 'devise', 'locales', 'en.yml'))
|
2009-10-11 11:15:48 +00:00
|
|
|
end
|
2009-10-21 02:12:21 +00:00
|
|
|
|
|
|
|
require 'devise/warden'
|
2009-10-21 16:59:12 +00:00
|
|
|
require 'devise/mapping'
|
2009-10-21 02:12:21 +00:00
|
|
|
require 'devise/routes'
|