Class: Effective::Log

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/effective/log.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#datatableObject

These 3 attr_accessors are set on the controller #show actions



6
7
8
# File 'app/models/effective/log.rb', line 6

def datatable
  @datatable
end

#next_logObject

Returns the value of attribute next_log.



7
8
9
# File 'app/models/effective/log.rb', line 7

def next_log
  @next_log
end

#prev_logObject

Returns the value of attribute prev_log.



8
9
10
# File 'app/models/effective/log.rb', line 8

def prev_log
  @prev_log
end

Instance Method Details

#associated_to_s=(value) ⇒ Object



46
47
48
# File 'app/models/effective/log.rb', line 46

def associated_to_s=(value)
  super(value.to_s[0...255].presence) # Take only first 255 characters
end

#detailsObject



54
55
56
# File 'app/models/effective/log.rb', line 54

def details
  self[:details] || {}
end

#log(message, status = EffectiveLogging.statuses.first, options = {}) ⇒ Object



50
51
52
# File 'app/models/effective/log.rb', line 50

def log(message, status = EffectiveLogging.statuses.first, options = {})
  EffectiveLogger.log(message, status, (options || {}).merge(parent: self))
end

#to_sObject



42
43
44
# File 'app/models/effective/log.rb', line 42

def to_s
  "Log #{id}"
end