Guest User

Untitled

a guest
Aug 16th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. # in the controller
  2. def index
  3. # Put the connections in a hash here so it's one DB query
  4. # instead of 10
  5. @connections = Hash.new
  6. User.where(
  7. id: current_user.cached_connections_ids
  8. ).each do |user|
  9. @connections[user.id] = user
  10. end
  11. end
Add Comment
Please, Sign In to add comment