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 3fdebbf..054695e 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