Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # in the controller
- def index
- # Put the connections in a hash here so it's one DB query
- # instead of 10
- @connections = Hash.new
- User.where(
- id: current_user.cached_connections_ids
- ).each do |user|
- @connections[user.id] = user
- end
- end
Add Comment
Please, Sign In to add comment