Skip to content

Commit

Permalink
Remove redundant condition
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
javierm committed Feb 5, 2021
1 parent a9adde1 commit 5090cbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/admin/organizations/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</thead>
<tbody>
<% @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) %>">
<td><%= organization.name %></td>
<td><%= organization.email %></td>
Expand Down

0 comments on commit 5090cbb

Please sign in to comment.