- if target_user.nil? # all traces
- if @user
- @traces = Trace.visible_to(@user) # 1
- else
- @traces = Trace.visible_to_all # 2
- end
- else
- if @user && @user == target_user
- @traces = @user.traces # 3 (check vs user id, so no join + can't pick up non-public traces by changing name)
- else
- @traces = target_user.traces.visible_to_all # 4
- end
- end
+ @traces = if target_user.nil? # all traces
+ if @user
+ Trace.visible_to(@user) # 1
+ else
+ Trace.visible_to_all # 2
+ end
+ elsif @user && @user == target_user
+ @user.traces # 3 (check vs user id, so no join + can't pick up non-public traces by changing name)
+ else
+ target_user.traces.visible_to_all # 4
+ end