1 class Tracepoint < ActiveRecord::Base
 
   4   set_table_name 'gps_points'
 
   6   validates_numericality_of :trackid, :only_integer => true
 
   7   validates_numericality_of :latitude, :only_integer => true
 
   8   validates_numericality_of :longitude, :only_integer => true
 
   9   validates_associated :trace
 
  10   validates_presence_of :timestamp
 
  12   belongs_to :trace, :foreign_key => 'gpx_id'
 
  15     el1 = XML::Node.new 'trkpt'
 
  16     el1['lat'] = self.lat.to_s
 
  17     el1['lon'] = self.lon.to_s