[refs #128] Add devise confirmable and reconfirmable options

This commit is contained in:
konstantin.grabar 2012-01-27 18:58:38 +04:00
parent 72fd821bc8
commit a5d6889999
4 changed files with 22 additions and 3 deletions

View File

@ -5,7 +5,7 @@ gem 'rails', '3.0.11' #, :git => 'git://github.com/rails/rails.git'
gem 'pg', '~> 0.11.0'
gem 'silent-postgres', '~> 0.1.1'
gem 'devise', '~> 1.5.2'
gem 'devise', '~> 2.0.0' #'~> 1.5.2'
gem 'omniauth', '~> 1.0.1'
gem 'omniauth-openid', '~> 1.0.1'
gem 'cancan', '~> 1.6.7'

View File

@ -4,7 +4,7 @@ class User < ActiveRecord::Base
LANGUAGES = LANGUAGES_FOR_SELECT.map(&:last)
devise :database_authenticatable, :registerable, :omniauthable, # :token_authenticatable, :encryptable, :timeoutable
:recoverable, :rememberable, :validatable #, :trackable, :confirmable, :lockable
:recoverable, :rememberable, :validatable, :confirmable, :reconfirmable #, :trackable, , :lockable
has_one :notifier, :class_name => 'Settings::Notifier' #:notifier

View File

@ -0,0 +1,15 @@
class AddConfirmableToUsers < ActiveRecord::Migration
def self.up
add_column :users, :confirmation_token, :string
add_column :users, :confirmed_at, :datetime
add_column :users, :confirmation_sent_at, :datetime
add_index :users, :confirmation_token, :unique => true
end
def self.down
remove_index :users, :confirmation_token
remove_column :users, :confirmation_sent_at
remove_column :users, :confirmed_at
remove_column :users, :confirmation_token
end
end

View File

@ -10,7 +10,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20120124065207) do
ActiveRecord::Schema.define(:version => 20120127141211) do
create_table "activity_feeds", :force => true do |t|
t.integer "user_id", :null => false
@ -315,8 +315,12 @@ ActiveRecord::Schema.define(:version => 20120124065207) do
t.string "uname"
t.string "role"
t.string "language", :default => "en"
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
end
add_index "users", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
add_index "users", ["uname"], :name => "index_users_on_uname", :unique => true