Actually mark a trace as being public based on the saved preference, rather than...
authorShaun McDonald <shaun@shaunmcdonald.me.uk>
Tue, 12 May 2009 15:29:27 +0000 (15:29 +0000)
committerShaun McDonald <shaun@shaunmcdonald.me.uk>
Tue, 12 May 2009 15:29:27 +0000 (15:29 +0000)
app/controllers/trace_controller.rb

index e6c732d2d3b760c29fbb48e4e685a32db37a56f0..47bc62be882021bfd8f4e305306774f9e9c9761b 100644 (file)
@@ -92,6 +92,13 @@ class TraceController < ApplicationController
   end
 
   def mine
+    # Load the preference of whether the user set the trace public the last time
+    @trace = Trace.new
+    if @user.preferences.find(:first, :conditions => {:k => "gps.trace.public", :v => "default"}).nil?
+      @trace.public = false
+    else 
+      @trace.public = true
+    end
     list(@user, "mine")
   end