]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/diary_entry.rb
Replace attr_accessible with strong parameters
[rails.git] / app / models / diary_entry.rb
index 99a56b2ce1b8c4486110c4a9ba5662be171c3667..f7584c6378cee90e82d3e0153d58ac0ade530ead 100644 (file)
@@ -24,9 +24,8 @@ class DiaryEntry < ActiveRecord::Base
                             :greater_than_or_equal_to => -180, :less_than_or_equal_to => 180
   validates_associated :language
 
-  attr_accessible :title, :body, :language_code, :latitude, :longitude
-
   after_initialize :set_defaults
+  after_save :spam_check
 
   def body
     RichText.new(read_attribute(:body_format), read_attribute(:body))
@@ -37,4 +36,8 @@ private
   def set_defaults
     self.body_format = "markdown" unless self.attribute_present?(:body_format)
   end
+
+  def spam_check
+    user.spam_check
+  end
 end