1 class Tracepoint < ActiveRecord::Base
4 self.table_name = "gps_points"
6 validates :trackid, :numericality => { :only_integer => true }
7 validates :latitude, :longitude, :numericality => { :only_integer => true }
8 validates :trace, :associated => true
9 validates :timestamp, :presence => true
11 belongs_to :trace, :foreign_key => "gpx_id"
13 def to_xml_node(print_timestamp = false)
14 el1 = XML::Node.new "trkpt"
17 el1 << (XML::Node.new("time") << timestamp.xmlschema) if print_timestamp