1 # frozen_string_literal: true
3 # == Schema Information
5 # Table name: gps_points
8 # trackid :integer not null
9 # latitude :integer not null
10 # longitude :integer not null
11 # gpx_id :bigint not null
17 # points_gpxid_idx (gpx_id)
18 # points_tile_idx (tile)
22 # gps_points_gpx_id_fkey (gpx_id => gpx_files.id)
25 class Tracepoint < ApplicationRecord
28 self.table_name = "gps_points"
30 validates :trackid, :numericality => { :only_integer => true }
31 validates :latitude, :longitude, :numericality => { :only_integer => true }
32 validates :trace, :associated => true
33 validates :timestamp, :presence => true
35 belongs_to :trace, :foreign_key => "gpx_id", :inverse_of => :points