Class: Messaged::Room

Inherits:
ApplicationRecord show all
Defined in:
app/models/messaged/room.rb

Instance Method Summary collapse

Instance Method Details

#ownerObject

Rooms should default to the person sending them, otherwise fallback to the chat room, and finally tenant if they exist.



27
28
29
30
31
# File 'app/models/messaged/room.rb', line 27

def owner
  return user if user
  return tenant if Messaged.tenant_class_name && tenant
  return nil # replace with user, tenant, or room
end