]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/traces_controller.rb
Truncate descriptions horizontally in changeset lists
[rails.git] / app / controllers / api / traces_controller.rb
index 629617f0b127c01685ed460f7a7ed0d688da89e6..956bcde6e82dccabb23e022919d0d87673e74ec3 100644 (file)
@@ -35,7 +35,7 @@ module Api
         trace = do_create(params[:file], tags, description, visibility)
 
         if trace.id
         trace = do_create(params[:file], tags, description, visibility)
 
         if trace.id
-          TraceImporterJob.perform_later(trace)
+          trace.schedule_import
           render :plain => trace.id.to_s
         elsif trace.valid?
           head :internal_server_error
           render :plain => trace.id.to_s
         elsif trace.valid?
           head :internal_server_error
@@ -66,7 +66,7 @@ module Api
       if trace.user == current_user
         trace.visible = false
         trace.save!
       if trace.user == current_user
         trace.visible = false
         trace.save!
-        TraceDestroyerJob.perform_later(trace)
+        trace.schedule_destruction
 
         head :ok
       else
 
         head :ok
       else
@@ -115,7 +115,7 @@ module Api
       trace.save!
 
       # Finally save the user's preferred privacy level
       trace.save!
 
       # Finally save the user's preferred privacy level
-      if pref = current_user.preferences.where(:k => "gps.trace.visibility").first
+      if pref = current_user.preferences.find_by(:k => "gps.trace.visibility")
         pref.v = visibility
         pref.save
       else
         pref.v = visibility
         pref.save
       else