Rails - Best-Practice: How to create dependent has_one relations

后端 未结 7 649
星月不相逢
星月不相逢 2020-12-04 05:39

Could you tell me whats the best practice to create has_one relations?

f.e. if i have a user model, and it must have a profile...

How could i accomplish that

7条回答
  •  情歌与酒
    2020-12-04 06:31

    There is a gem for this:

    https://github.com/jqr/has_one_autocreate

    Looks like it is a bit old now. (not work with rails3)

提交回复
热议问题