This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Home
Welcome to the vote_fu wiki!
Karma Issues:
has_karma conflicts with sqlite3 or Postgresql.
Without this fix, everyone had a karma of 0 (on sqlite3) or worse, the whole thing buckles down on postgresql (postgres is strongly typed an will not sum boolean fields). The above fix works with both.
Fix:
module InstanceMethods def karma(options = {})- count the total number of votes on all of the voteable objects that are related to this object
#The following line is not SQLite3 compatible, because boolean are stored as ‘f’ or ‘t’, not ‘1’, or ‘0’
#self.karma_voteable.sum(:vote, options_for_karma(options))
self.karma_voteable.find(:all, options_for_karma(options).merge(:conditions => [‘vote = ?’, true])).length
end
Merging the options and conditions might not be the best for scalability, but it works.






