diff options
author | Nihad Abbasov <narkoz.2008@gmail.com> | 2011-11-15 11:08:05 +0400 |
---|---|---|
committer | Nihad Abbasov <narkoz.2008@gmail.com> | 2011-11-15 11:08:05 +0400 |
commit | 003bf61258ea20128315076936f09ea198e56bcb (patch) | |
tree | 85345a86c9c72080b4319fffdb11010a9b2b4aac /app | |
parent | 8d74123d61e83c29b5449773e1c471d2e2aa126f (diff) |
add auth token for users
Diffstat (limited to 'app')
-rw-r--r-- | app/models/user.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 1d41028d59a..0320a6208eb 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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 |