Closed carlosdp closed 12 years ago
I added some changes to how the voting is setup. I added a Voter model to track whether someone voted and a Vote model for actual votes.
For Board Elections, we can manually set the counter_cache for :votes instead of actually attaching Votes.
Sorry about the stupid merge commits, won't happen again.
I used Ryan Bates' nested_form gem to create the form that was designed on Monday. It needs styling, but it works. You put the andrew id of the nominees and you are good.
I removed the validates presence of for the relations on each model because that's not how rails handles them. Rails likes to assign relations after creating the record which means those validations would always fail.
Need to comb through these models again to protect some attributes from the mass-assignment exploit, but otherwise we are off to a good start. Thoughts?