阅读背景:

如何验证has_many的唯一性:通过连接模型?

来源:互联网 

I have users and issues joined by a votership model. Users can vote on issues. They can either vote up or down (which is recorded in the votership model). First, I want to be able to prevent users from casting multiple votes in one direction. Second, I want to allow users to cast the opposite vote. So, if they voted up, they should still be able to vote down which will replace the up vote. Users should never be able to vote on an issue twice. Here are my files:I have users and issues joined by a votership m




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: