Module: TurboChat::ModelExtensions::ChatParticipant::InstanceMethods

Defined in:
lib/turbo_chat/model_extensions/chat_participant.rb

Instance Method Summary collapse

Instance Method Details

#active_chat_membershipsObject



31
32
33
# File 'lib/turbo_chat/model_extensions/chat_participant.rb', line 31

def active_chat_memberships
  chat_memberships.active
end

#joined_chat?(chat) ⇒ Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/turbo_chat/model_extensions/chat_participant.rb', line 35

def joined_chat?(chat)
  active_chat_memberships.exists?(chat_id: chat.id)
end