Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
36 additions
and
560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,37 @@ | ||
require 'mongo_mapper' | ||
require 'devise/orm/mongo_mapper/compatibility' | ||
require 'devise/orm/mongo_mapper/schema' | ||
require 'devise/orm/mongo_mapper/date_time' | ||
require 'devise/orm/mongo_mapper/mm-validations' | ||
require 'orm_adapter/adapters/mongo_mapper' | ||
|
||
module Devise | ||
module Orm | ||
module MongoMapper | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
extend Devise::Models | ||
extend Devise::Orm::MongoMapper::Hook | ||
end | ||
|
||
module Hook | ||
def devise_modules_hook! | ||
extend Schema | ||
include Compatibility | ||
include Validatable | ||
yield | ||
return unless Devise.apply_schema | ||
devise_modules.each { |m| send(m) if respond_to?(m, true) } | ||
end | ||
end | ||
|
||
end | ||
|
||
module Schema | ||
include Devise::Schema | ||
|
||
# Tell how to apply schema methods | ||
def apply_devise_schema(name, type, options={}) | ||
type = Time if type == DateTime | ||
key(name, type, options) | ||
end | ||
end | ||
|
||
end | ||
end | ||
end | ||
|
||
MongoMapper::Document.append_extensions(Devise::Models) | ||
MongoMapper::Document.append_extensions(Devise::Orm::MongoMapper::Hook) | ||
|
||
MongoMapper::Document.plugin Devise::Orm::MongoMapper |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.