There is a concept called Null Pattern, you could implement something like this
class NullAuthor
def name
"Deleted user"
end
end
and you would use it like this inside your ActiveRecord model
class Post < ActiveRecord::Base
belongs_to :user
def author
@author ||= if user.present?
user
else
NullAuthor.new
end
end
end
In this way, you never have to check if the post user is nil or not :)