Fix backwards compatibility code to handle an old style public
authorTom Hughes <tom@compton.nu>
Mon, 31 Aug 2009 23:28:51 +0000 (23:28 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 31 Aug 2009 23:28:51 +0000 (23:28 +0000)
attribute correctly. Closes #2242.

app/controllers/trace_controller.rb

index 10aecd4adc7733e8c2309253bbbed6d5ad2f4b02..51e7f9b834c53e8544dbf6030d33f964a0e8ddce 100644 (file)
@@ -293,12 +293,16 @@ class TraceController < ApplicationController
     if request.post?
       tags = params[:tags] || ""
       description = params[:description] || ""
-      visibility = params[:visibility] || false
+      visibility = params[:visibility]
 
-      if params[:public] && !visibility
-        visibility = "public"
+      if visibility.nil?
+        if params[:public]
+          visibility = "public"
+        else
+          visibility = "private"
+        end
       end
-      
+
       if params[:file].respond_to?(:read)
         do_create(params[:file], tags, description, visibility)