]> git.openstreetmap.org Git - rails.git/blob - app/models/tracepoint.rb
Add frozen_string_literal comments to ruby files
[rails.git] / app / models / tracepoint.rb
1 # frozen_string_literal: true
2
3 # == Schema Information
4 #
5 # Table name: gps_points
6 #
7 #  altitude  :float
8 #  trackid   :integer          not null
9 #  latitude  :integer          not null
10 #  longitude :integer          not null
11 #  gpx_id    :bigint           not null
12 #  timestamp :datetime
13 #  tile      :bigint
14 #
15 # Indexes
16 #
17 #  points_gpxid_idx  (gpx_id)
18 #  points_tile_idx   (tile)
19 #
20 # Foreign Keys
21 #
22 #  gps_points_gpx_id_fkey  (gpx_id => gpx_files.id)
23 #
24
25 class Tracepoint < ApplicationRecord
26   include GeoRecord
27
28   self.table_name = "gps_points"
29
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
34
35   belongs_to :trace, :foreign_key => "gpx_id", :inverse_of => :points
36 end