]> source.dussan.org Git - redmine.git/commitdiff
Rails3: model: replace deprecated 'before_create' method at Token model
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 21 Sep 2011 05:16:19 +0000 (05:16 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 21 Sep 2011 05:16:19 +0000 (05:16 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7428 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/token.rb

index c6d6f3b90ef78bd64ba468cd7274d50be8a6dc3f..89d1352eeb3f3fa09a66c3b3e73b507c0928251f 100644 (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