source: subversion/sites/rails_port/app/models/tracepoint.rb @ 2852

Last change on this file since 2852 was 2776, checked in by steve, 13 years ago

updates from hacking day

File size: 438 bytes
Line 
1class Tracepoint < ActiveRecord::Base
2set_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
25end
Note: See TracBrowser for help on using the repository browser.