]> git.openstreetmap.org Git - rails.git/commitdiff
Only initialize creation_time if it isn't already set.
authorTom Hughes <tom@compton.nu>
Wed, 15 Aug 2007 07:26:33 +0000 (07:26 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 15 Aug 2007 07:26:33 +0000 (07:26 +0000)
app/models/user.rb

index 3fdebbf618110749a588078e32d3c73dfe2d9faa..054695e5b8f74089bb5a822ac192272690bf9da0 100644 (file)
@@ -20,7 +20,7 @@ class User < ActiveRecord::Base
   before_save :encrypt_password
 
   def after_initialize
-    self.creation_time = Time.now
+    self.creation_time = Time.now if self.creation_time.nil?
   end
 
   def encrypt_password