]> git.openstreetmap.org Git - rails.git/blob - app/models/tracepoint.rb
fixed user messaging stuff
[rails.git] / app / models / tracepoint.rb
1 class Tracepoint < ActiveRecord::Base
2 set_table_name 'gps_points'
3
4 #  validates_numericality_of :latitude
5 #  validates_numericality_of :longitude
6
7   belongs_to :user
8   belongs_to :trace, :foreign_key => 'gpx_id'
9
10   def lat=(l)
11     self.latitude = l * 1000000
12   end
13
14   def lng=(l)
15     self.longitude = l * 1000000
16   end
17
18   def lat
19     return self.latitude.to_f / 1000000
20   end
21
22   def lon
23     return self.longitude.to_f / 1000000
24   end
25 end