]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/trace.rb
Validate passwords properly when creating an account. Fixes #419.
[rails.git] / app / models / trace.rb
index 0307b5f653eac11a6563c7b21b5fa7ceae23a36a..d44d71027564ff044ba1f5f371cc721440b245c7 100644 (file)
@@ -6,8 +6,8 @@ class Trace < ActiveRecord::Base
   validates_inclusion_of :inserted, :in => [ true, false]
   
   belongs_to :user
-  has_many :tags, :class_name => 'Tracetag', :foreign_key => 'gpx_id', :dependent => :destroy
-  has_many :points, :class_name => 'Tracepoint', :foreign_key => 'gpx_id', :dependent => :destroy
+  has_many :tags, :class_name => 'Tracetag', :foreign_key => 'gpx_id', :dependent => :delete_all
+  has_many :points, :class_name => 'Tracepoint', :foreign_key => 'gpx_id', :dependent => :delete_all
 
   def tagstring=(s)
     self.tags = s.split().collect {|tag|
@@ -110,6 +110,7 @@ class Trace < ActiveRecord::Base
         tp.lat = point['latitude'].to_f
         tp.lng = point['longitude'].to_f
         tp.altitude = point['altitude'].to_f
+        tp.timestamp = point['timestamp']
         tp.user_id = user.id
         tp.gpx_id = id
         tp.trackid = point['segment'].to_i