]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/trace.rb
Don't fill in from_display_name for messages - it can be got by
[rails.git] / app / models / trace.rb
index ed0ba72e8a707b3ad9ede5de19495bee09f0c517..155e495a34b485b9123323088e45f58c2bfb2094 100644 (file)
@@ -73,7 +73,7 @@ class Trace < ActiveRecord::Base
   end
 
   def mime_type
-    filetype = `file -bz #{trace_name}`.chomp
+    filetype = `/usr/bin/file -bz #{trace_name}`.chomp
     gzipped = filetype =~ /gzip compressed/
     bzipped = filetype =~ /bzip2 compressed/
     zipped = filetype =~ /Zip archive/
@@ -92,7 +92,7 @@ class Trace < ActiveRecord::Base
   end
 
   def extension_name
-    filetype = `file -bz #{trace_name}`.chomp
+    filetype = `/usr/bin/file -bz #{trace_name}`.chomp
     gzipped = filetype =~ /gzip compressed/
     bzipped = filetype =~ /bzip2 compressed/
     zipped = filetype =~ /Zip archive/
@@ -141,7 +141,7 @@ class Trace < ActiveRecord::Base
       logger.info("GPX Import importing #{name} (#{id}) from #{user.email}")
 
       # TODO *nix specific, could do to work on windows... would be functionally inferior though - check for '.gz'
-      filetype = `file -bz #{trace_name}`.chomp
+      filetype = `/usr/bin/file -bz #{trace_name}`.chomp
       gzipped = filetype =~ /gzip compressed/
       bzipped = filetype =~ /bzip2 compressed/
       zipped = filetype =~ /Zip archive/
@@ -188,7 +188,6 @@ class Trace < ActiveRecord::Base
         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
         tp.save!