Only initialize creation_time if it isn't already set.

This commit is contained in:
Tom Hughes 2007-08-15 07:26:33 +00:00
parent b62561cdb5
commit 6adf8fe384

View 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