X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/cb87f02642d0097ebc067ca1f9371dde274a41e3..1e57189366c0e4a49cb29658e9bf5985996709a2:/app/models/diary_comment.rb?ds=sidebyside diff --git a/app/models/diary_comment.rb b/app/models/diary_comment.rb index 8a99c7b2c..475872b26 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, :invalid_chars => true validates :diary_entry, :user, :associated => true after_save :spam_check