Guest User

Untitled

a guest
Nov 24th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. module Group::ConversationsHelper
  2. def add_people_to_group_conv_list(conversation)
  3. contacts = current_user.all_active_contacts
  4. users_in_conv = conversation.users
  5. add_people_to_conv_list = []
  6. contacts.each do |contact|
  7. # if the contact is already in the conversation, remove it from the list
  8. if !users_in_conv.include?(contact)
  9. add_people_to_conv_list << contact
  10. end
  11. end
  12. add_people_to_conv_list
  13. end
  14. end
Add Comment
Please, Sign In to add comment