Only initialize creation_time if it isn't already set.
This commit is contained in:
parent
b62561cdb5
commit
6adf8fe384
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue