Ticket #1395: diary.patch

File diary.patch, 828 bytes (added by Thomas Wood, 11 years ago)
  • app/models/diary_entry.rb

     
    77  validates_presence_of :title, :body
    88  validates_length_of :title, :within => 1..255
    99  validates_length_of :language, :within => 2..3, :allow_nil => true
    10   validates_numericality_of :latitude, :allow_nil => true
    11   validates_numericality_of :longitude, :allow_nil => true
     10  validates_numericality_of :latitude, :allow_nil => true,
     11                            :greater_than_or_equal_to => -90, :less_than_or_equal_to => 90
     12  validates_numericality_of :longitude, :allow_nil => true,
     13                            :greater_than_or_equal_to => -180, :less_than_or_equal_to => 180
    1214  validates_associated :user
    1315end