X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c7061991e74a20cc0576a3afa269821a87178f77..5d3ecffa28510c867665001a7615559a185869c6:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index 1a0e3415e..e255dc216 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -217,8 +217,8 @@ class User < ActiveRecord::Base score = description.spam_score / 4.0 score += diary_entries.where("created_at > ?", 1.day.ago).count * 10 - score += diary_entry_score / diary_entries.length if diary_entries.length > 0 - score += diary_comment_score / diary_comments.length if diary_comments.length > 0 + score += diary_entry_score / diary_entries.length unless diary_entries.empty? + score += diary_comment_score / diary_comments.length unless diary_comments.empty? score -= changeset_score score -= trace_score