add auth token for users

This commit is contained in:
Nihad Abbasov 2011-11-15 11:08:05 +04:00
parent 8d74123d61
commit 003bf61258
5 changed files with 19 additions and 7 deletions

View file

@ -1,7 +1,7 @@
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable,
devise :database_authenticatable, :token_authenticatable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
@ -25,6 +25,7 @@ class User < ActiveRecord::Base
:foreign_key => :assignee_id,
:dependent => :destroy
before_create :ensure_authentication_token
scope :not_in_project, lambda { |project| where("id not in (:ids)", :ids => project.users.map(&:id) ) }
def identifier