]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/diary_entry.rb
be a bit smarter about enlarging the bbox (note to self: must remember to put this...
[rails.git] / app / models / diary_entry.rb
index 2da92d400648a564eecc1bdd66c6841190b6245f..dd1f9882a7a4726ffff14147292b1891a0584893 100644 (file)
@@ -1,2 +1,11 @@
 class DiaryEntry < ActiveRecord::Base
+  belongs_to :user
+  has_many :diary_comments, :include => :user,
+                            :conditions => "users.visible = 1",
+                            :order => "diary_comments.id"
+
+  validates_presence_of :title, :body
+  validates_numericality_of :latitude, :allow_nil => true
+  validates_numericality_of :longitude, :allow_nil => true
+  validates_associated :user
 end