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