mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Use ActiveSupport.on_load
to hook into Active Record and Mongoid.
This commit is contained in:
parent
92bb772d36
commit
c2c74b0a39
3 changed files with 9 additions and 3 deletions
|
@ -12,6 +12,8 @@
|
|||
* Remove the `Devise::Models::Recoverable#after_password_reset` method.
|
||||
* bug fixes
|
||||
* Fix an `ActionDispatch::IllegalStateError` when testing controllers with Rails 5 rc 2(by @hamadata).
|
||||
* Use `ActiveSupport.on_load` hooks to include Devise on `ActiveRecord` and `Mongoid`,
|
||||
avoiding autoloading these constants too soon (by @lucasmazza, @rafaelfranca).
|
||||
* enhancements
|
||||
* Display the minimum password length on `registrations/edit` view (by @Yanchek99).
|
||||
* You can disable Devise's routes reloading on boot by through the `reload_routes = false` config.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'orm_adapter/adapters/active_record'
|
||||
|
||||
ActiveRecord::Base.extend Devise::Models
|
||||
ActiveSupport.on_load(:active_record) do
|
||||
extend Devise::Models
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'orm_adapter/adapters/mongoid'
|
||||
ActiveSupport.on_load(:mongoid) do
|
||||
require 'orm_adapter/adapters/mongoid'
|
||||
|
||||
Mongoid::Document::ClassMethods.send :include, Devise::Models
|
||||
Mongoid::Document::ClassMethods.send :include, Devise::Models
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue