Class: CompanyIntegration

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

Defined Under Namespace

Classes: Statuses

Instance Method Summary collapse

Methods inherited from ApplicationRecord

define_decrypted_attribute, define_decrypted_attributes, #errors_in_bullet_points, primary_connection, special_connection

Instance Method Details

#errorObject



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/models/company_integration.rb', line 19

def error
  nil

  # This is timing out and should be fixed before uncommenting
  # last_reference_event = reference_events.last
  # return unless last_reference_event

  # return unless last_reference_event.error?

  # {
  #   message: I18n.t('messages.agendrix_integration_failed_contact_agendrix')
  # }
end

#statusObject



33
34
35
36
37
38
# File 'app/models/company_integration.rb', line 33

def status
  return Statuses::INACTIVE unless active
  return Statuses::ERROR if error.present?

  Statuses::ACTIVE
end