X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/dd7ef37ec023646120358a0a6a7959a392b79f1c..85d17f257c338f668a1d17d9fc62a2f48ec84230:/app/models/spam_observer.rb diff --git a/app/models/spam_observer.rb b/app/models/spam_observer.rb index 8b5212111..888b4a0b9 100644 --- a/app/models/spam_observer.rb +++ b/app/models/spam_observer.rb @@ -3,9 +3,9 @@ class SpamObserver < ActiveRecord::Observer def after_save(record) case - when record.is_a?(User): user = record - when record.is_a?(DiaryEntry): user = record.user - when record.is_a?(DiaryComment): user = record.user + when record.is_a?(User) then user = record + when record.is_a?(DiaryEntry) then user = record.user + when record.is_a?(DiaryComment) then user = record.user end if user.status == "active" and user.spam_score > SPAM_THRESHOLD