Module: SanteyVote::Voteable::SingletonMethods

Defined in:
lib/santey_vote/voteable.rb

Instance Method Summary collapse

Instance Method Details

#find_votes_cast_by_user(user) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/santey_vote/voteable.rb', line 17

def find_votes_cast_by_user(user)
  voteable = ActiveRecord::Base.send(:class_name_of_active_record_descendant, self).to_s
  Vote.find(:all,
    :conditions => ["user_id = ? and voteable_type = ?", user.id, voteable],
    :order => "created_at DESC"
  )
end