| 1 | # Be sure to restart your server when you modify this file. |
| 2 | # |
| 3 | # Points are a simple integer value which are given to "meritable" resources |
| 4 | # according to rules in +app/models/merit/point_rules.rb+. They are given on |
| 5 | # actions-triggered, either to the action user or to the method (or array of |
| 6 | # methods) defined in the +:to+ option. |
| 7 | # |
| 8 | # 'score' method may accept a block which evaluates to boolean |
| 9 | # (recieves the object as parameter) |
| 10 | |
| 11 | module Merit |
| 12 | class PointRules |
| 13 | include Merit::PointRulesMethods |
| 14 | |
| 15 | def initialize |
| 16 | # score 10, :on => 'users#create' do |user| |
| 17 | # user.bio.present? |
| 18 | # end |
| 19 | # |
| 20 | # score 15, :on => 'reviews#create', :to => [:reviewer, :reviewed] |
| 21 | # |
| 22 | # score 20, :on => [ |
| 23 | # 'comments#create', |
| 24 | # 'photos#create' |
| 25 | # ] |
| 26 | # |
| 27 | # score -10, :on => 'comments#destroy' |
| 28 | end |
| 29 | end |
| 30 | end |