mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-29 18:22:53 +00:00
17 lines
388 B
Ruby
17 lines
388 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Pubsubable
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
# Used by the actionCable/PubSub Service we use for real time communications
|
|
has_secure_token :pubsub_token
|
|
end
|
|
|
|
def pubsub_token
|
|
# backfills tokens for existing records
|
|
regenerate_pubsub_token if self[:pubsub_token].blank? && persisted?
|
|
self[:pubsub_token]
|
|
end
|
|
end
|