class FixxpertAvailabilityType

Schema Information

Table name: fixxpert_availability_types

id                :integer          not null, primary key
fixxpert_id       :integer
availability_type :integer
enabled           :boolean          default(TRUE)
company_id        :integer
created_at        :datetime
updated_at        :datetime

Constants

TYPES

Type of fixxpert's availability

Public Instance Methods

availablility_type_text() click to toggle source

Returns text for Fixxpert availability type.

# File app/models/fixxpert_availability_type.rb, line 27
def availablility_type_text
  if availability_type
    case TYPES[availability_type]
      when 'video'
        'video_expert_online'
      else
        TYPES[availability_type]
    end
  end
end
trigger_event_for_video_session() click to toggle source

Trigger event for video session(i.e. assigns channel for video session)

# File app/models/fixxpert_availability_type.rb, line 39
def trigger_event_for_video_session
  client = ActsAsTenant.current_tenant.pusher_configuration.client
  client["presence-user"].trigger_async('expert-session-added-or-remove', {fixxpert_id: fixxpert_id})
end