]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/diary_entry.rb
Convert friend changeset selection to use Arel queries
[rails.git] / app / models / diary_entry.rb
index 0524b75cf3a0616938da05ce8a27531fabb3b30b..318672c03bb84f30952de4f4a96036e1bfeb48da 100644 (file)
@@ -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