I'm developing a site that will have a model for users, a model for submissions, and a model for ratings. Each submission may have only one rating per user. My question is how should I set this up in my models?
Asked
Active
Viewed 216 times
1 Answers
5
class Submission
has_many :ratings
validates_uniqueness_of :rating, :scope => :user_id
end

Ken
- 5,074
- 6
- 30
- 26