[Enhancement] Group widget messages by users (#367)

* Remove thumbnail

* Show grouped messages
This commit is contained in:
Pranav Raj S
2019-12-15 23:53:04 +05:30
committed by Sojan Jose
parent 5c7c325c9c
commit 17587d8a0c
15 changed files with 157 additions and 96 deletions

View File

@@ -47,6 +47,7 @@ class User < ApplicationRecord
include DeviseTokenAuth::Concerns::User
include Events::Types
include Pubsubable
include Rails.application.routes.url_helpers
devise :database_authenticatable,
:registerable,
@@ -103,9 +104,18 @@ class User < ApplicationRecord
Rails.configuration.dispatcher.dispatch(AGENT_REMOVED, Time.zone.now, account: account)
end
def avatar_url
if avatar.attached? && avatar.representable?
url_for(avatar.representation(resize: '250x250'))
else
''
end
end
def push_event_data
{
name: name
name: name,
avatar_url: avatar_url
}
end
end