X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/9deeae3f9630bb85fc420a9eb09edb6318d32f09..78db9e72bb3653ee8c666f5d10a231aecad9d984:/app/models/diary_entry.rb diff --git a/app/models/diary_entry.rb b/app/models/diary_entry.rb index 0524b75cf..318672c03 100644 --- a/app/models/diary_entry.rb +++ b/app/models/diary_entry.rb @@ -8,11 +8,13 @@ class DiaryEntry < ActiveRecord::Base has_many :visible_comments, :class_name => "DiaryComment", :include => :user, :conditions => { - :users => { :visible => true }, + :users => { :status => ["active", "confirmed" ] }, :visible => true }, :order => "diary_comments.id" + scope :visible, where(:visible => true) + validates_presence_of :title, :body validates_length_of :title, :within => 1..255 #validates_length_of :language, :within => 2..5, :allow_nil => false