Fix issues with belongs_to deleted in rails 4