]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/spam_observer.rb
Improve tests for trace RSS feeds
[rails.git] / app / models / spam_observer.rb
index 8b52121114581ce211145fbaac539111a218baf5..07fa84ffd07c6975d0043c71b086d62cbbda2fc2 100644 (file)
@@ -3,13 +3,13 @@ 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
-      user.update_attributes(:status => "suspended")
+      user.update_column(:status, "suspended")
     end
   end
 end