FIX: Do not count nil or blank values as votes (#33)

This commit is contained in:
Yaw Anokwa 2018-08-07 20:16:47 -07:00 committed by Sam
parent 67c847fc5a
commit a6b0e9753a
1 changed files with 1 additions and 1 deletions

View File

@ -109,7 +109,7 @@ after_initialize do
class ::User
def vote_count
if self.custom_fields["votes"]
user_votes = self.custom_fields["votes"].reject { |v| v.nil? }.length
user_votes = self.custom_fields["votes"].reject { |v| v.blank? }.length
else
0
end