Rails3: model: replace deprecated 'before_create' method at Token model

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7428 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-09-21 05:16:19 +00:00
parent 92403eb855
commit ca9c6bc254
1 changed files with 2 additions and 2 deletions

View File

@ -19,11 +19,11 @@ class Token < ActiveRecord::Base
belongs_to :user
validates_uniqueness_of :value
before_create :delete_previous_tokens
before_create :delete_previous_tokens, :generate_new_token
@@validity_time = 1.day
def before_create
def generate_new_token
self.value = Token.generate_token_value
end