Commit 171bb6e3aec1eb3ae3783cc116bc329fd6ea1064

Authored by Victor Costa
1 parent 362d23e0

Move uniqueness validation from vote_fu to vote plugin

(ActionItem2786)
plugins/vote/lib/ext/vote.rb 0 → 100644
... ... @@ -0,0 +1,7 @@
  1 +require_dependency 'models/vote'
  2 +
  3 +class Vote
  4 +
  5 + validates_uniqueness_of :voteable_id, :scope => [:voteable_type, :voter_type, :voter_id]
  6 +
  7 +end
... ...
vendor/plugins/vote_fu/lib/models/vote.rb
... ... @@ -12,6 +12,6 @@ class Vote < ActiveRecord::Base
12 12 attr_accessible :vote, :voter, :voteable
13 13  
14 14 # Uncomment this to limit users to a single vote on each item.
15   - validates_uniqueness_of :voteable_id, :scope => [:voteable_type, :voter_type, :voter_id]
  15 + #validates_uniqueness_of :voteable_id, :scope => [:voteable_type, :voter_type, :voter_id]
16 16  
17 17 end
... ...