New VoteFu Feature: karma counting

Written by pete

Topics: Uncategorized

I have just introduced the “has_karma” mixin to VoteFu. It aims to assign a karma score to the owners of voteable objects. This is designed to allow you to see which users are submitting the most highly voted content. Currently, karma is only “positive”. That is, +1 votes add to karma, but -1 votes do not detract from it.

1
2
3
4
5
6
7
8
9
10
11
class User 
  has_many :posts
  has_karma :posts
end
 
class Post
  acts_as_voteable
end
 
# in your view, you can then do this: 
Karma: <%= @user.karma %>

This feature is new and probably going to be enhanced significantly, but useful enough that I’m releasing it now.

  • Jazzy

    Hi Pete,

    The vote-fu plugin really looks like a great plugin with awesome features. But the git hub repository does not seem to be having it. Is there something wrong with the repository or permissions you set for the viewing of the repository?

    Could you email me a zip or tar of the plugin to us_12345678 at yahoo dot com. Thanks

  • http://blog.peteonrails.com peteonrails

    Jazzy,

    Thanks for bringing that to my attention. Something in the hosted repository went haywire. I've repushed the code to the repository, and it should be available now for download at: http://github.com/peteonrails/vote_fu/tree/master

    Alternately, you can always try:

    gem install peteonrails-vote_fu –source http://gems.github.com

    Thanks!

    –Pete

  • Jazzy

    Hi Pete,

    Thanks for your prompt reply. I was able to download the plugin from the git repository. And I ran in to the problem in the first step!

    I tried running the command './script/generate voteable' in hopes of generating the migration but nothing happened. I checked the log file and it seems that the I get this message in the environment's log file '** vote_fu: initialized properly.'.

    Any pointers on what might be actually going wrong or if there is something that I'm missing?

    Any help would be highly appreciated. Thanks.

    -Jazzy

  • Jazzy

    Never mind I just figured out. It needs to be ./script/generate vote_fu

    Thanks,
    -Jazzy

  • Jazzy

    Hi Pete,

    Thanks for your prompt reply. I was able to download the plugin from the git repository. And I ran in to the problem in the first step!

    I tried running the command './script/generate voteable' in hopes of generating the migration but nothing happened. I checked the log file and it seems that the I get this message in the environment's log file '** vote_fu: initialized properly.'.

    Any pointers on what might be actually going wrong or if there is something that I'm missing?

    Any help would be highly appreciated. Thanks.

    -Jazzy

  • Jazzy

    Never mind I just figured out. It needs to be ./script/generate vote_fu

    Thanks,

    -Jazzy