X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/d0089f0ce81ef10ca7ed43969d83d8b77014fa11..64146b4f3614854e6a0f8430f27261fe0a0ca26c:/app/controllers/traces_controller.rb diff --git a/app/controllers/traces_controller.rb b/app/controllers/traces_controller.rb index c77d884b3..b78ae2959 100644 --- a/app/controllers/traces_controller.rb +++ b/app/controllers/traces_controller.rb @@ -92,8 +92,8 @@ class TracesController < ApplicationController def show @trace = Trace.find(params[:id]) - if @trace && @trace.visible? && - (@trace.public? || @trace.user == current_user) + if @trace&.visible? && + (@trace&.public? || @trace&.user == current_user) @title = t ".title", :name => @trace.name else flash[:error] = t ".trace_not_found" @@ -318,7 +318,7 @@ class TracesController < ApplicationController visibility = params[:visibility] if visibility.nil? - visibility = if params[:public] && params[:public].to_i.nonzero? + visibility = if params[:public]&.to_i&.nonzero? "public" else "private"