X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/aa1fb6dbb8c2e71b8ce8c231ae1272a2dfebd75a..24b4538f8fef9f97098a1dfd82ff56bd61103c96:/app/models/diary_comment.rb?ds=inline diff --git a/app/models/diary_comment.rb b/app/models/diary_comment.rb index 8a99c7b2c..ade7a64ea 100644 --- a/app/models/diary_comment.rb +++ b/app/models/diary_comment.rb @@ -26,7 +26,9 @@ class DiaryComment < ActiveRecord::Base belongs_to :user belongs_to :diary_entry - validates :body, :presence => true + scope :visible, -> { where(:visible => true) } + + validates :body, :presence => true, :characters => true validates :diary_entry, :user, :associated => true after_save :spam_check