Commit 8bd4d8d49d14af7701f2dbc92ca525356ab5d792
1 parent
27f9186b
Exists in
master
and in
1 other branch
Remove unneeded profile_action
Showing
1 changed file
with
2 additions
and
13 deletions
Show diff stats
lib/merit/point_rules.rb
... | ... | @@ -93,7 +93,6 @@ module Merit |
93 | 93 | value: 1, |
94 | 94 | description: _('Friends'), |
95 | 95 | default_weight: 5, |
96 | - profile_action: false | |
97 | 96 | }, |
98 | 97 | profile_completion: { |
99 | 98 | action: ['profile#create', 'profile#update'], |
... | ... | @@ -103,8 +102,7 @@ module Merit |
103 | 102 | description: _('Profile Completion'), |
104 | 103 | default_weight: 100, |
105 | 104 | model_name: "User", |
106 | - condition: lambda {|person| person.person? and person.profile_completion_score_condition }, | |
107 | - profile_action: false | |
105 | + condition: lambda {|person, profile| person.person? and person.profile_completion_score_condition }, | |
108 | 106 | }, |
109 | 107 | follower: { |
110 | 108 | action: 'articlefollower#create', |
... | ... | @@ -115,7 +113,6 @@ module Merit |
115 | 113 | default_weight: 10, |
116 | 114 | model: 'ArticleFollower', |
117 | 115 | condition: lambda {|follow, profile| profile.nil? or follow.article.profile == profile }, |
118 | - profile_action: true | |
119 | 116 | }, |
120 | 117 | followed_article_author: { |
121 | 118 | action: 'articlefollower#create', |
... | ... | @@ -126,7 +123,6 @@ module Merit |
126 | 123 | default_weight: 20, |
127 | 124 | model: 'ArticleFollower', |
128 | 125 | condition: lambda {|follow, profile| profile.nil? or follow.article.profile == profile }, |
129 | - profile_action: true | |
130 | 126 | }, |
131 | 127 | #mobilizer: { |
132 | 128 | #action: 'mobilize#create', |
... | ... | @@ -136,7 +132,6 @@ module Merit |
136 | 132 | #description: _('Mobilized Article Author'), |
137 | 133 | #default_weight: 60, |
138 | 134 | #condition: lambda {|target, profile| profile.nil? or target.source.profile == profile }, |
139 | - #profile_action: true | |
140 | 135 | #}, |
141 | 136 | #mobilized_article_author: { |
142 | 137 | #action: 'mobilize#create', |
... | ... | @@ -146,7 +141,6 @@ module Merit |
146 | 141 | #description: _('Mobilized Article Author'), |
147 | 142 | #default_weight: 70, |
148 | 143 | #condition: lambda {|follow, profile| profile.nil? or follow.source.profile == profile }, |
149 | - #profile_action: true | |
150 | 144 | #}, |
151 | 145 | #mobilized_article: { |
152 | 146 | #action: 'mobilize#create', |
... | ... | @@ -156,7 +150,6 @@ module Merit |
156 | 150 | #description: _('Mobilized Article Author'), |
157 | 151 | #default_weight: 70, |
158 | 152 | #condition: lambda {|follow, profile| profile.nil? or follow.source.profile == profile }, |
159 | - #profile_action: true | |
160 | 153 | #} |
161 | 154 | } |
162 | 155 | |
... | ... | @@ -168,11 +161,7 @@ module Merit |
168 | 161 | def condition(setting, target, profile) |
169 | 162 | condition = setting[:condition] |
170 | 163 | if condition.present? |
171 | - if setting.fetch(:profile_action, true) | |
172 | - condition.call(target, profile) | |
173 | - else | |
174 | - condition.call(target) | |
175 | - end | |
164 | + condition.call(target, profile) | |
176 | 165 | else |
177 | 166 | true |
178 | 167 | end | ... | ... |