X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/aa1fb6dbb8c2e71b8ce8c231ae1272a2dfebd75a..a20e28809f5ca1e3f3579faeaf118fff3ecc4994:/app/models/diary_comment.rb?ds=sidebyside diff --git a/app/models/diary_comment.rb b/app/models/diary_comment.rb index 8a99c7b2c..63eae3f21 100644 --- a/app/models/diary_comment.rb +++ b/app/models/diary_comment.rb @@ -26,6 +26,8 @@ class DiaryComment < ActiveRecord::Base belongs_to :user belongs_to :diary_entry + scope :visible, -> { where(:visible => true) } + validates :body, :presence => true validates :diary_entry, :user, :associated => true