Forum: Ruby on Rails validating votes w/ act_as_voteable

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Abed21abff74d51f99d8ae6ad8e5a3e9?d=identicon&s=25 (Guest)
on 2007-06-06 00:14
(Received via mailing list)
I'm have trouble implementing a uniqueness check w/ act_as_voteable
plugin. The 2 approaches I've taken:

vote.rb (plugin dir): I tried adding the line
"validates_uniqueness_of" to the votes.rb but there seems to be no

albums.rb (model dir): the validation does not pass but the vote is
being added regardless.

How would I add a model level validation to the act_as_voteable

voting action
        vote = => true, :user_id =>
  albums = Albums.find(params[:id])
  albums.votes << vote

class Vote < ActiveRecord::Base
  belongs_to :user
  def self.find_votes_cast_by_user(user)
      :conditions => ["user_id = ?",],
      :order => "created_at DESC"

thanks Dan
This topic is locked and can not be replied to.