Class: MnoEnterprise::AuditEventsListener

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/mno_enterprise/audit_events_listener.rb

Instance Method Summary collapse

Instance Method Details

#info(key, current_user_id, description, subject_type, subject_id, metadata) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/mno_enterprise/audit_events_listener.rb', line 10

def info(key, current_user_id, description, subject_type, subject_id, )
  organization_id = if (subject_type == 'MnoEnterprise::Organization') then
                      subject_id
                    elsif .is_a?(Hash)
                      [:organization_id].presence
                    end
  body = {
    data: {
      key: key,
      user_id: current_user_id,
      description: description,
      metadata: ,
      subject_type: subject_type,
      subject_id: subject_id,
    }
  }
  body[:data][:organization_id] = organization_id if organization_id
  self.class.post('', body: body)
rescue Net::ReadTimeout
  # Meant to fail
end