开发者

ruby on rails models

I am writting social network. I have grou开发者_运维技巧p's blog and user's blog, then I have group's photos and user's photos How I must design models? all posts(photos) in one db table or in different?


It is preferable to have a single table only for photos, especially if you have multiple photos for each group or user. You could use Single Table Inheritance or Polymorphic Associations to store photos from groups and users in it. I would recommend to read some good books about the topic, Practical Rails Social Networking Sites and RailsSpace: Building a Social Networking Website with Ruby on Rails. Both are recommendable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜