]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/diary_comment.rb
Localisation updates from http://translatewiki.net.
[rails.git] / app / models / diary_comment.rb
index 075d288edb8e0b644970b7b515a4f6967506abbe..bea1c7f0d5b83bac5e31b0761a0027694144d588 100644 (file)
@@ -8,6 +8,7 @@ class DiaryComment < ActiveRecord::Base
   attr_accessible :body
 
   after_initialize :set_defaults
+  after_save :spam_check
 
   def body
     RichText.new(read_attribute(:body_format), read_attribute(:body))
@@ -27,4 +28,8 @@ private
   def set_defaults
     self.body_format = "markdown" unless self.attribute_present?(:body_format)
   end
+
+  def spam_check
+    user.spam_check
+  end
 end