revert the commit 7a4b664577e7d4960690076ffc61869c1e43e644, as the workaround to fix"
NoMethodError (undefined method `id' for nil:NilClass):
  app/models/document.rb:46:in `after_initialize'