Class: Effective::Datatables::Logs

Inherits:
Effective::Datatable
  • Object
show all
Includes:
EffectiveLoggingHelper
Defined in:
app/models/effective/datatables/logs.rb

Constant Summary

Constants included from EffectiveLoggingHelper

EffectiveLoggingHelper::ALLOWED_ATTRIBUTES, EffectiveLoggingHelper::ALLOWED_TAGS

Instance Method Summary collapse

Methods included from EffectiveLoggingHelper

#bootstrap_class_for_status, #effective_logging_object_link_to, #format_log_details_value, #parents_of_log, #render_log, #tableize_hash

Instance Method Details

#collection ⇒ Object

A nil attributes means give me all the top level log entries If we set a log_id then it's for sub logs



48
49
50
51
52
53
54
# File 'app/models/effective/datatables/logs.rb', line 48

def collection
  if attributes[:user_id].present?
    Effective::Log.unscoped.where(:parent_id => attributes[:log_id]).where(:user_id => attributes[:user_id]).includes(:user)
  else
    Effective::Log.unscoped.where(:parent_id => attributes[:log_id]).includes(:user)
  end
end