Module: EffectiveLoggingLog
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/concerns/effective_logging_log.rb
Overview
EffectiveLoggingLog
Mark your log model with effective_logging_log to get all the includes
Defined Under Namespace
Modules: Base, ClassMethods
Instance Method Summary
collapse
Instance Method Details
#associated_to_s=(value) ⇒ Object
74
75
76
|
# File 'app/models/concerns/effective_logging_log.rb', line 74
def associated_to_s=(value)
super(value.to_s[0...255].presence) end
|
#details ⇒ Object
83
84
85
|
# File 'app/models/concerns/effective_logging_log.rb', line 83
def details
Hash(self[:details])
end
|
#log(message, status = nil, options = {}) ⇒ Object
78
79
80
81
|
# File 'app/models/concerns/effective_logging_log.rb', line 78
def log(message, status = nil, options = {})
status ||= EffectiveLogging.statuses.first
EffectiveLogger.log(message, status, options)
end
|
#next_log ⇒ Object
87
88
89
|
# File 'app/models/concerns/effective_logging_log.rb', line 87
def next_log
self.class.order(id: :asc).where('id > ?', id).first
end
|
#prev_log ⇒ Object
91
92
93
|
# File 'app/models/concerns/effective_logging_log.rb', line 91
def prev_log
self.class.order(id: :desc).where('id < ?', id).first
end
|
#to_s ⇒ Object
70
71
72
|
# File 'app/models/concerns/effective_logging_log.rb', line 70
def to_s
"#{model_name.human} ##{id}"
end
|