更新时间:2023-12-02 22:35:28
查看 rails 协会基础知识
你的协会看起来像
class User < AR:Base
has_one :profile
end
class Profile < AR:Base
belongs_to :user
end
哦,表配置文件必须有一个 user_id 列,其中包含用户的外键.
oh, the table profiles must have a user_id column with the foreign key to the user.