* Replace find_by().nil? with exists? find_by asks the DB and the ORM to load the entire object in memory, then it is discarded just know if it exists or not. Exists will just return true or false * Use present? in lieu of any? when it is proper A request for any? followed by each in a most likely full collection results in two SQL queries. present? preloads the objects, so it results in one single connection because the objects are already in memory.
21 lines
787 B
Text
21 lines
787 B
Text
<div id="sidebar-wrapper-right" class="sidebar-wrapper sidebar-wrapper-right">
|
|
<div class="sidebar-bg" id="sidebar-bg-right"></div>
|
|
<div class="side-bar sidebar-additional showing" id="sidebar-additional">
|
|
<% if @organization.users.present? %>
|
|
<div class="widget">
|
|
<div class="widget-suggested-follows-container">
|
|
<header><h4>meet the team</h4></header>
|
|
<div class="widget-body">
|
|
<% @organization.users.each do |user| %>
|
|
<div class="widget-user-pic">
|
|
<a href="/<%= user.username %>">
|
|
<img src="<%= ProfileImage.new(user).get(90) %>" />
|
|
</a>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|