Avoid mass assignment error in spam observer
authorTom Hughes <tom@compton.nu>
Sat, 10 Mar 2012 14:42:09 +0000 (14:42 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 10 Mar 2012 14:42:09 +0000 (14:42 +0000)
app/models/spam_observer.rb

index 888b4a0b9cb6719624a509a343dc21fc717857f4..07fa84ffd07c6975d0043c71b086d62cbbda2fc2 100644 (file)
@@ -9,7 +9,7 @@ class SpamObserver < ActiveRecord::Observer
     end
 
     if user.status == "active" and user.spam_score > SPAM_THRESHOLD
-      user.update_attributes(:status => "suspended")
+      user.update_column(:status, "suspended")
     end
   end
 end