- @traces = if target_user.nil? # all traces
- if current_user
- Trace.visible_to(current_user) # 1
- else
- Trace.visible_to_all # 2
- end
- elsif current_user && current_user == target_user
- current_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
+ traces = if target_user.nil? # all traces
+ if current_user
+ Trace.visible_to(current_user) # 1
+ else
+ Trace.visible_to_all # 2
+ end
+ elsif current_user && current_user == target_user
+ current_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