Commit da2e34e6b1d2fe23d2fa1822d805d9e20d987761
1 parent
ab0c4dc7
Exists in
master
and in
1 other branch
Update point weights
Showing
1 changed file
with
56 additions
and
6 deletions
Show diff stats
lib/merit/point_rules.rb
... | ... | @@ -9,7 +9,7 @@ module Merit |
9 | 9 | to: :author, |
10 | 10 | value: 1, |
11 | 11 | description: _('Comment author'), |
12 | - default_weight: 150, | |
12 | + default_weight: 40, | |
13 | 13 | condition: lambda {|comment, profile| comment.source.profile == profile}, |
14 | 14 | }, |
15 | 15 | comment_article_author: { |
... | ... | @@ -45,7 +45,7 @@ module Merit |
45 | 45 | to: :author, |
46 | 46 | value: 1, |
47 | 47 | description: _('Article author'), |
48 | - default_weight: 500, | |
48 | + default_weight: 10, | |
49 | 49 | condition: lambda {|article, profile| article.profile == profile}, |
50 | 50 | }, |
51 | 51 | article_community: { |
... | ... | @@ -54,7 +54,7 @@ module Merit |
54 | 54 | to: :profile, |
55 | 55 | value: 1, |
56 | 56 | description: _('Article community'), |
57 | - default_weight: 600, | |
57 | + default_weight: 10, | |
58 | 58 | condition: lambda {|article, profile| article.profile.community? and article.profile == profile } |
59 | 59 | }, |
60 | 60 | vote_voteable_author: { |
... | ... | @@ -64,7 +64,7 @@ module Merit |
64 | 64 | profile: lambda {|vote| vote.voteable.profile}, |
65 | 65 | value: lambda {|vote| vote.vote}, |
66 | 66 | description: _('Author of a voted content'), |
67 | - default_weight: 50, | |
67 | + default_weight: 20, | |
68 | 68 | condition: lambda {|vote, profile| vote.voteable.profile == profile } |
69 | 69 | }, |
70 | 70 | vote_voteable: { |
... | ... | @@ -74,7 +74,7 @@ module Merit |
74 | 74 | profile: lambda {|vote| vote.voteable.profile}, |
75 | 75 | value: lambda {|vote| vote.vote}, |
76 | 76 | description: _('Voted content'), |
77 | - default_weight: 50, | |
77 | + default_weight: 30, | |
78 | 78 | condition: lambda {|vote, profile| vote.voteable.profile == profile } |
79 | 79 | }, |
80 | 80 | vote_voter: { |
... | ... | @@ -105,7 +105,57 @@ module Merit |
105 | 105 | model_name: "User", |
106 | 106 | condition: lambda {|user| user.person.profile_completion_score_condition }, |
107 | 107 | profile_action: false |
108 | - } | |
108 | + }, | |
109 | + follower: { | |
110 | + action: 'follow#create', | |
111 | + undo_action: 'follow#destroy', | |
112 | + to: lambda {|follow| follow.profile }, | |
113 | + value: 1, | |
114 | + description: _('Follower'), | |
115 | + default_weight: 10, | |
116 | + condition: lambda {|follow, profile| follow.source.profile == profile }, | |
117 | + profile_action: true | |
118 | + }, | |
119 | + followed_article_author: { | |
120 | + action: 'follow#create', | |
121 | + undo_action: 'follow#destroy', | |
122 | + to: lambda {|follow| follow.source.author }, | |
123 | + value: 1, | |
124 | + description: _('Followed'), | |
125 | + default_weight: 20, | |
126 | + condition: lambda {|follow, profile| follow.source.profile == profile }, | |
127 | + profile_action: true | |
128 | + }, | |
129 | + #mobilizer: { | |
130 | + #action: 'mobilize#create', | |
131 | + #undo_action: 'mobilize#destroy', | |
132 | + #to: lambda {|target| target.source.author }, | |
133 | + #value: 1, | |
134 | + #description: _('Mobilized Article Author'), | |
135 | + #default_weight: 60, | |
136 | + #condition: lambda {|target, profile| target.source.profile == profile }, | |
137 | + #profile_action: true | |
138 | + #}, | |
139 | + #mobilized_article_author: { | |
140 | + #action: 'mobilize#create', | |
141 | + #undo_action: 'mobilize#destroy', | |
142 | + #to: lambda {|target| target.source.author }, | |
143 | + #value: 1, | |
144 | + #description: _('Mobilized Article Author'), | |
145 | + #default_weight: 70, | |
146 | + #condition: lambda {|follow, profile| follow.source.profile == profile }, | |
147 | + #profile_action: true | |
148 | + #}, | |
149 | + #mobilized_article: { | |
150 | + #action: 'mobilize#create', | |
151 | + #undo_action: 'mobilize#destroy', | |
152 | + #to: lambda {|target| target.source }, | |
153 | + #value: 1, | |
154 | + #description: _('Mobilized Article Author'), | |
155 | + #default_weight: 70, | |
156 | + #condition: lambda {|follow, profile| follow.source.profile == profile }, | |
157 | + #profile_action: true | |
158 | + #} | |
109 | 159 | } |
110 | 160 | |
111 | 161 | def calculate_score(target, weight, value) | ... | ... |