简体   繁体   中英

Model for UnderReview/Published User Content

I am building a user-generated website, but want to be able to moderate them. I also need the posts have a static id, because I want to use the facebook social plugins. I was initially thinking about having two distinct tables 'review' and 'published' and move the posts from one table to another. However, I didnt know how make them retain their id, as the incremental id of the table is used?

I could also use one table and have a published attribute, but I feel this solution is not really performant, but the only way to preserve the id?

btw, i am using rails

Why not have a state column in the posts table to show if a post is reviewed or published? If you want to get fancy you can use something like the aasm gem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM