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

move include Devise::Models::Authenticatable inside devise_modules_hook! call

This allows alternate ORMs to run compatibility setup code before
Authenticatable is included.

The particular issue for dm-devise is that DataMapper does not have a
before_validation method, which is called when Authenticatable is included
(as of plataformatec/devise@bd27bf76). dm-devise adds before_validation in
it's devise_modules_hook!
This commit is contained in:
Jared Morgan 2011-12-20 15:52:26 -06:00
parent 89db0dd44d
commit f8ea5e0942

View file

@ -48,7 +48,6 @@ module Devise
# for a complete description on those values.
#
def devise(*modules)
include Devise::Models::Authenticatable
options = modules.extract_options!.dup
selected_modules = modules.map(&:to_sym).uniq.sort_by do |s|
@ -56,6 +55,7 @@ module Devise
end
devise_modules_hook! do
include Devise::Models::Authenticatable
selected_modules.each do |m|
mod = Devise::Models.const_get(m.to_s.classify)