Class: Effective::Log
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Effective::Log
- Defined in:
- app/models/effective/log.rb
Instance Method Summary collapse
- #associated_to_s=(value) ⇒ Object
- #details ⇒ Object
- #log(message, status = EffectiveLogging.statuses.first, options = {}) ⇒ Object
- #next_log ⇒ Object
- #prev_log ⇒ Object
- #to_s ⇒ Object
Instance Method Details
#associated_to_s=(value) ⇒ Object
41 42 43 |
# File 'app/models/effective/log.rb', line 41 def associated_to_s=(value) super(value.to_s[0...255].presence) # Take only first 255 characters end |
#details ⇒ Object
49 50 51 |
# File 'app/models/effective/log.rb', line 49 def details self[:details] || {} end |
#log(message, status = EffectiveLogging.statuses.first, options = {}) ⇒ Object
45 46 47 |
# File 'app/models/effective/log.rb', line 45 def log(, status = EffectiveLogging.statuses.first, = {}) EffectiveLogger.log(, status, ) end |
#next_log ⇒ Object
53 54 55 |
# File 'app/models/effective/log.rb', line 53 def next_log Log.order(id: :asc).where('id > ?', id).first end |
#prev_log ⇒ Object
57 58 59 |
# File 'app/models/effective/log.rb', line 57 def prev_log Log.order(id: :desc).where('id < ?', id).first end |
#to_s ⇒ Object
37 38 39 |
# File 'app/models/effective/log.rb', line 37 def to_s "Log #{id}" end |