I have several tables, let s say for example: articles, thoughts and pages and I want to be able to add comments for each one of them. Should I add comments tables for each on of the table (articles_comments,pages_comments...) or somehow do general comments table for all kinds of data (plz extend how to implement that in rails if you can)
我有这样的想法,即发表载有评论的表格。
[COMMENTS] ID, MODEL, MODEL_ID, USER_ID, TEXT
while model contain the destination table(articles/posts...) and model_id the foreign id in the table, is it good solution? the problem is that I have no idea how to implement such model in rails.
I also would like to know how Facebook implemented their posts db. fb user can post any kind of data (question/status/poll/picture) and it s just fit in the feeds table with current order and comments.