Commit e244e74cf641b2c6a418b06f3d3caf70817b2d7a

Authored by Hugo Melo
1 parent e1291889

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: {
... ... @@ -106,7 +106,57 @@ module Merit
106 106 model_name: "User",
107 107 condition: lambda {|user| user.person.profile_completion_score_condition },
108 108 profile_action: false
109   - }
  109 + },
  110 + follower: {
  111 + action: 'follow#create',
  112 + undo_action: 'follow#destroy',
  113 + to: lambda {|follow| follow.profile },
  114 + value: 1,
  115 + description: _('Follower'),
  116 + default_weight: 10,
  117 + condition: lambda {|follow, profile| follow.source.profile == profile },
  118 + profile_action: true
  119 + },
  120 + followed_article_author: {
  121 + action: 'follow#create',
  122 + undo_action: 'follow#destroy',
  123 + to: lambda {|follow| follow.source.author },
  124 + value: 1,
  125 + description: _('Followed'),
  126 + default_weight: 20,
  127 + condition: lambda {|follow, profile| follow.source.profile == profile },
  128 + profile_action: true
  129 + },
  130 + #mobilizer: {
  131 + #action: 'mobilize#create',
  132 + #undo_action: 'mobilize#destroy',
  133 + #to: lambda {|target| target.source.author },
  134 + #value: 1,
  135 + #description: _('Mobilized Article Author'),
  136 + #default_weight: 60,
  137 + #condition: lambda {|target, profile| target.source.profile == profile },
  138 + #profile_action: true
  139 + #},
  140 + #mobilized_article_author: {
  141 + #action: 'mobilize#create',
  142 + #undo_action: 'mobilize#destroy',
  143 + #to: lambda {|target| target.source.author },
  144 + #value: 1,
  145 + #description: _('Mobilized Article Author'),
  146 + #default_weight: 70,
  147 + #condition: lambda {|follow, profile| follow.source.profile == profile },
  148 + #profile_action: true
  149 + #},
  150 + #mobilized_article: {
  151 + #action: 'mobilize#create',
  152 + #undo_action: 'mobilize#destroy',
  153 + #to: lambda {|target| target.source },
  154 + #value: 1,
  155 + #description: _('Mobilized Article Author'),
  156 + #default_weight: 70,
  157 + #condition: lambda {|follow, profile| follow.source.profile == profile },
  158 + #profile_action: true
  159 + #}
110 160 }
111 161  
112 162 def calculate_score(target, weight, value)
... ...