Skip to content

Commit

Permalink
Check if has_custom_fields has given us multiple values
Browse files Browse the repository at this point in the history
  • Loading branch information
angusmcleod committed Jun 11, 2018
1 parent f2ac40d commit 32a970c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin.rb
Expand Up @@ -100,8 +100,8 @@ def rating_enabled?
end

def rating_count
if self.custom_fields['rating_count']
self.custom_fields['rating_count'].to_i
if count = self.custom_fields['rating_count']
count.is_a?(Array) ? count[0].to_i : count.to_i
else
## 'mirgration' - to be removed
if rating_enabled? && average_rating.present?
Expand Down

0 comments on commit 32a970c

Please sign in to comment.