I am working on CMS and I need to implement a reputation system which enable these features
- Badges
- Points
- Ranks
I found this gem from twitter, activerecord-reputation-system but I'm not pretty sure how to use this on my own application. Appreciate if someone can help me out. Here is my scenario. (Example only)
class Manager < ActiveRecord::Base
end
class Employee < ActiveRecord::Base
has_many :jobs
end
class Category < ActiveRecord::Base
# has a name and points field
# example: Cat A, 5
# example: Cat B, 10
end
class Job < ActiveRecord::Base
belongs_to :employee
belongs_to :category
end
So the models are Managers, Employees, Jobs, Categories.
Basically Manager
create Job
entries and assign Employee
and Category
for each Job entry.
What I need to do is, everytime when Manager create a Job entry, assign points to Employee based on the Job Category they belongs to, and calculate Rank or assign badge as per the points they have earned. (Using Category.points)
Is this doable from above Gem? if so, how do I use has_reputation
in my models.
Thanks