From ca9c6bc25415fc5ad4f0a44daa4611ce143dfba6 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Wed, 21 Sep 2011 05:16:19 +0000 Subject: [PATCH] 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 --- app/models/token.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/token.rb b/app/models/token.rb index c6d6f3b90..89d1352ee 100644 --- a/app/models/token.rb +++ b/app/models/token.rb @@ -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 -- 2.39.5