search for: proposal_id

Displaying 1 result from an estimated 1 matches for "proposal_id".

Did you mean: proposal3d
2006 Feb 17
2
validate uniqueness of two fields
I have Proposals and Members and Members can vote for a proposal only once. So, I have "Vote belongs_to :member, :proposal", but to make sure a member only votes once, I want to make sure that there isn''t a vote in the db with that member_id and proposal_id. I can just put the appropriate find in a vote.valid? but I wanted to make sure I wasn''t missing a nice rails shortcut. In other words, can I do something with "validates_uniqueness_of" to make it consider a pair of columns, member_id and proposal_id? thanks, b