OSDN Git Service

fix js filer
[pettanr/pettanr.git] / app / models / demand_user.rb
1 class DemandUser < ActiveRecord::Base
2   has_one :demander
3   
4   # Include default devise modules. Others available are:
5   # :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
6   devise :database_authenticatable, :registerable,
7          :recoverable, :rememberable, :trackable, :validatable, :token_authenticatable
8
9   # Setup accessible (or protected) attributes for your model
10   attr_accessible :email, :password, :password_confirmation, :remember_me
11   
12   def create_token
13     self.ensure_authentication_token
14     self.save
15   end
16   
17   def delete_token
18     self.authentication_token = nil
19     self.save
20   end
21   
22 end