Module: EffectiveMessagingUser

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/effective_messaging_user.rb

Overview

EffectiveMessagingUser

Mark your user model with effective_messaging_user to get all the includes

Defined Under Namespace

Modules: Base, ClassMethods

Instance Method Summary collapse

Instance Method Details

#chat_user(chat:) ⇒ Object

Instance Methods



29
30
31
# File 'app/models/concerns/effective_messaging_user.rb', line 29

def chat_user(chat:)
  chat_users.find { |cu| cu.chat_id == chat.id }
end

#effective_messaging_anonymous_nameObject



37
38
39
40
# File 'app/models/concerns/effective_messaging_user.rb', line 37

def effective_messaging_anonymous_name
  raise('to be implemented by the app')
  # Base64::encode64("#{id}-#{created_at.strftime('%F')}").chomp.first(8)
end

#effective_messaging_display_nameObject



33
34
35
# File 'app/models/concerns/effective_messaging_user.rb', line 33

def effective_messaging_display_name
  to_s
end