Remove redundant condition

The association `organization.user` returns `nil` when the user is
hidden.

This was discovered thanks to the `Style/AndOr` rule. We were using
`and` and `||` on the same line, which is confusing.
This commit is contained in:
Javi Martín
2020-10-18 13:37:34 +02:00
parent e7ca01fad7
commit 1c2886debb

View File

@@ -22,7 +22,7 @@
</thead> </thead>
<tbody> <tbody>
<% @organizations.each do |organization| %> <% @organizations.each do |organization| %>
<% hidden += 1 and next if organization.user.nil? || organization.user.hidden? %> <% hidden += 1 and next if organization.user.nil? %>
<tr id="<%= dom_id(organization) %>"> <tr id="<%= dom_id(organization) %>">
<td><%= organization.name %></td> <td><%= organization.name %></td>
<td><%= organization.email %></td> <td><%= organization.email %></td>