forked from heartcombo/devise
-
Notifications
You must be signed in to change notification settings - Fork 4
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
José Valim
committed
May 6, 2012
1 parent
7aa93a3
commit 32f20dd
Showing
11 changed files
with
20 additions
and
296 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
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
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,44 +1,3 @@ | ||
require 'orm_adapter/adapters/active_record' | ||
|
||
module Devise | ||
module Orm | ||
# This module contains some helpers and handle schema (migrations): | ||
# | ||
# create_table :accounts do |t| | ||
# t.database_authenticatable | ||
# t.confirmable | ||
# t.recoverable | ||
# t.rememberable | ||
# t.trackable | ||
# t.lockable | ||
# t.timestamps | ||
# end | ||
# | ||
# However this method does not add indexes. If you need them, here is the declaration: | ||
# | ||
# add_index "accounts", ["email"], :name => "email", :unique => true | ||
# add_index "accounts", ["confirmation_token"], :name => "confirmation_token", :unique => true | ||
# add_index "accounts", ["reset_password_token"], :name => "reset_password_token", :unique => true | ||
# | ||
module ActiveRecord | ||
module Schema | ||
include Devise::Schema | ||
|
||
# Tell how to apply schema methods. | ||
def apply_devise_schema(name, type, options={}) | ||
@__devise_warning_raised ||= begin | ||
$stderr.puts "\n[DEVISE] You are using t.database_authenticatable and others in your migration " \ | ||
"and this feature is deprecated. Please simply use Rails helpers instead as mentioned here:\n" \ | ||
"https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0-migration-schema-style\n\n" | ||
true | ||
end | ||
column name, type.to_s.downcase.to_sym, options | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
ActiveRecord::Base.extend Devise::Models | ||
ActiveRecord::ConnectionAdapters::Table.send :include, Devise::Orm::ActiveRecord::Schema | ||
ActiveRecord::ConnectionAdapters::TableDefinition.send :include, Devise::Orm::ActiveRecord::Schema | ||
ActiveRecord::Base.extend Devise::Models |
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,31 +1,3 @@ | ||
require 'orm_adapter/adapters/mongoid' | ||
|
||
module Devise | ||
module Orm | ||
module Mongoid | ||
module Hook | ||
def devise_modules_hook! | ||
extend Schema | ||
yield | ||
return unless Devise.apply_schema | ||
devise_modules.each { |m| send(m) if respond_to?(m, true) } | ||
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 | ||
field name, { :type => type }.merge!(options) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
Mongoid::Document::ClassMethods.class_eval do | ||
include Devise::Models | ||
include Devise::Orm::Mongoid::Hook | ||
end | ||
Mongoid::Document::ClassMethods.send :include, Devise::Models |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.