From f3bd88ed2f517175e2d428bebafd28ad6ddd5b56 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Mon, 7 Apr 2014 10:58:55 -0400 Subject: Used Ternary operation to blank out current user in the collect of show.html in peer review. --- app/views/matches/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index c92aea3..e8eaaa7 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -87,7 +87,7 @@ <% @match.teams.each do |team| %> <% if team.users.include?(current_user) %>
    - <% team.users.collect{|u| u.user_name}.each do |k| %> + <% team.users.collect { |u| (u.user_name == @current_user) ? u.user_name : "" }.each do |k| %>
  1. <%= k%>
    <% if (@tournament.game_id == 1) %> -- cgit v1.2.3-54-g00ecf From 45df045451bdafb630a5bbdb812510e35f2d2a2d Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Mon, 7 Apr 2014 11:07:14 -0400 Subject: Fixed the rejection to be more Ruby-like with .reject.collect --- app/views/matches/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index e8eaaa7..34a7432 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -87,7 +87,7 @@ <% @match.teams.each do |team| %> <% if team.users.include?(current_user) %>
      - <% team.users.collect { |u| (u.user_name == @current_user) ? u.user_name : "" }.each do |k| %> + <% team.users.reject { |u| (u.user_name == @current_user.user_name) }.collect {|u| u.user_name }.each do |k| %>
    1. <%= k%>
      <% if (@tournament.game_id == 1) %> -- cgit v1.2.3-54-g00ecf