@carlosantoniodasilva I know it can be done this way, but it's too verbose to do it for every class, IMHO this is a better option
class Post < ActiveRecord::Base belongs_to :user, nil_class: NilUser end
I would actually go even further then that (needs to be accepted by core members of course)
class Post < ActiveRecord::Base belongs_to :user #Will try to load NilUser.new if nil automatically
From what I have seen done in rails over the years is that the first option is done first and the second later.