Class: Lesli::Account::Log

Inherits:
ApplicationRecord
  • Object
show all
Defined in:
app/models/lesli/account/log.rb

Class Method Summary collapse

Class Method Details

.log(system_module_action, system_process, title = nil, description = nil, payload = nil) ⇒ Object



37
38
39
40
41
42
43
44
45
# File 'app/models/lesli/account/log.rb', line 37

def self.log(system_module_action, system_process, title=nil, description=nil, payload=nil)
    .first.activities.create(
        system_module: system_module_action,
        system_process: system_process,
        description: description,
        title: title,
        payload: payload
    )
end

.log_email(system_module_action, title = "email_sent", description = "email", payload = nil) ⇒ Object



47
48
49
50
51
52
53
54
55
# File 'app/models/lesli/account/log.rb', line 47

def self.log_email(system_module_action, title="email_sent", description="email", payload=nil)
    &.first&.logs&.create(
        system_module: system_module_action,
        system_process: "mailer",
        description: description,
        payload: payload,
        title: title
    )
end