-
Notifications
You must be signed in to change notification settings - Fork 194
/
merit_rank_rules.erb
31 lines (29 loc) · 1.03 KB
/
merit_rank_rules.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Be sure to restart your server when you modify this file.
#
# 5 stars is a common ranking use case. They are not given at specified
# actions like badges, you should define a cron job to test if ranks are to be
# granted.
#
# +set_rank+ accepts:
# * :+level+ ranking level (greater is better)
# * :+to+ model or scope to check if new rankings apply
# * :+level_name+ attribute name (default is empty and results in 'level'
# attribute, if set it's appended like 'level_#{level_name}')
module Merit
class RankRules
include Merit::RankRulesMethods
def initialize
# set_rank :level => 1, :to => Commiter.active do |commiter|
# commiter.repositories.count > 1 && commiter.followers >= 10
# end
#
# set_rank :level => 2, :to => Commiter.active do |commiter|
# commiter.branches.count > 1 && commiter.followers >= 10
# end
#
# set_rank :level => 3, :to => Commiter.active do |commiter|
# commiter.branches.count > 2 && commiter.followers >= 20
# end
end
end
end