From 543e8c5503dbcc637ae9e95255b8c63d7765c530 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 31 Aug 2009 23:28:51 +0000 Subject: [PATCH] Fix backwards compatibility code to handle an old style public attribute correctly. Closes #2242. --- app/controllers/trace_controller.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index 10aecd4ad..51e7f9b83 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -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) -- 2.39.5