use classs_name and foreign_key restore

when the model has_one use class_name or foreign_key, restore use
class_name or setting the foreign_key.