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 Oct 25, 2020
1 parent 028124b commit 1ca10ba
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 @@ -29,7 +29,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 1ca10ba

Please sign in to comment.