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,7 +93,6 @@ module Merit | ||
93 | value: 1, | 93 | value: 1, |
94 | description: _('Friends'), | 94 | description: _('Friends'), |
95 | default_weight: 5, | 95 | default_weight: 5, |
96 | - profile_action: false | ||
97 | }, | 96 | }, |
98 | profile_completion: { | 97 | profile_completion: { |
99 | action: ['profile#create', 'profile#update'], | 98 | action: ['profile#create', 'profile#update'], |
@@ -103,8 +102,7 @@ module Merit | @@ -103,8 +102,7 @@ module Merit | ||
103 | description: _('Profile Completion'), | 102 | description: _('Profile Completion'), |
104 | default_weight: 100, | 103 | default_weight: 100, |
105 | model_name: "User", | 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 | follower: { | 107 | follower: { |
110 | action: 'articlefollower#create', | 108 | action: 'articlefollower#create', |
@@ -115,7 +113,6 @@ module Merit | @@ -115,7 +113,6 @@ module Merit | ||
115 | default_weight: 10, | 113 | default_weight: 10, |
116 | model: 'ArticleFollower', | 114 | model: 'ArticleFollower', |
117 | condition: lambda {|follow, profile| profile.nil? or follow.article.profile == profile }, | 115 | condition: lambda {|follow, profile| profile.nil? or follow.article.profile == profile }, |
118 | - profile_action: true | ||
119 | }, | 116 | }, |
120 | followed_article_author: { | 117 | followed_article_author: { |
121 | action: 'articlefollower#create', | 118 | action: 'articlefollower#create', |
@@ -126,7 +123,6 @@ module Merit | @@ -126,7 +123,6 @@ module Merit | ||
126 | default_weight: 20, | 123 | default_weight: 20, |
127 | model: 'ArticleFollower', | 124 | model: 'ArticleFollower', |
128 | condition: lambda {|follow, profile| profile.nil? or follow.article.profile == profile }, | 125 | condition: lambda {|follow, profile| profile.nil? or follow.article.profile == profile }, |
129 | - profile_action: true | ||
130 | }, | 126 | }, |
131 | #mobilizer: { | 127 | #mobilizer: { |
132 | #action: 'mobilize#create', | 128 | #action: 'mobilize#create', |
@@ -136,7 +132,6 @@ module Merit | @@ -136,7 +132,6 @@ module Merit | ||
136 | #description: _('Mobilized Article Author'), | 132 | #description: _('Mobilized Article Author'), |
137 | #default_weight: 60, | 133 | #default_weight: 60, |
138 | #condition: lambda {|target, profile| profile.nil? or target.source.profile == profile }, | 134 | #condition: lambda {|target, profile| profile.nil? or target.source.profile == profile }, |
139 | - #profile_action: true | ||
140 | #}, | 135 | #}, |
141 | #mobilized_article_author: { | 136 | #mobilized_article_author: { |
142 | #action: 'mobilize#create', | 137 | #action: 'mobilize#create', |
@@ -146,7 +141,6 @@ module Merit | @@ -146,7 +141,6 @@ module Merit | ||
146 | #description: _('Mobilized Article Author'), | 141 | #description: _('Mobilized Article Author'), |
147 | #default_weight: 70, | 142 | #default_weight: 70, |
148 | #condition: lambda {|follow, profile| profile.nil? or follow.source.profile == profile }, | 143 | #condition: lambda {|follow, profile| profile.nil? or follow.source.profile == profile }, |
149 | - #profile_action: true | ||
150 | #}, | 144 | #}, |
151 | #mobilized_article: { | 145 | #mobilized_article: { |
152 | #action: 'mobilize#create', | 146 | #action: 'mobilize#create', |
@@ -156,7 +150,6 @@ module Merit | @@ -156,7 +150,6 @@ module Merit | ||
156 | #description: _('Mobilized Article Author'), | 150 | #description: _('Mobilized Article Author'), |
157 | #default_weight: 70, | 151 | #default_weight: 70, |
158 | #condition: lambda {|follow, profile| profile.nil? or follow.source.profile == profile }, | 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,11 +161,7 @@ module Merit | ||
168 | def condition(setting, target, profile) | 161 | def condition(setting, target, profile) |
169 | condition = setting[:condition] | 162 | condition = setting[:condition] |
170 | if condition.present? | 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 | else | 165 | else |
177 | true | 166 | true |
178 | end | 167 | end |