Class: ErpTechSvcs::ErpTechSvcsAuditLog

Inherits:
Object
  • Object
show all
Defined in:
lib/erp_tech_svcs/erp_tech_svcs_audit_log.rb

Class Method Summary collapse

Class Method Details

.successful_login(user) ⇒ Object

log when a user logs out



16
17
18
19
20
21
22
23
# File 'lib/erp_tech_svcs/erp_tech_svcs_audit_log.rb', line 16

def (user)
  AuditLog.create(
      :party_id => user.party.id,
      :event_record => user,
      :audit_log_type => AuditLogType.find_by_type_and_subtype_iid('application','successful_login'),
      :description => "User #{user.username} successfully logged in."
  )
end

.successful_logout(user) ⇒ Object

log when a user logs out



6
7
8
9
10
11
12
13
# File 'lib/erp_tech_svcs/erp_tech_svcs_audit_log.rb', line 6

def successful_logout(user)
  AuditLog.create(
      :party_id => user.party.id,
      :event_record => user,
      :audit_log_type => AuditLogType.find_by_type_and_subtype_iid('application','successful_logout'),
      :description => "User #{user.username} successfully logged out."
  )
end