X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/15b104f4ff4614aa78c01180b6a9b89dd5a1400f..77dcaef44c19d43a3944affbfcf2d037dc11aba5:/app/models/diary_comment.rb?ds=sidebyside 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