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:
parent
92403eb855
commit
ca9c6bc254
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue