Class: Effective::Datatables::Trash
- Inherits:
-
Effective::Datatable
- Object
- Effective::Datatable
- Effective::Datatables::Trash
- Includes:
- EffectiveLoggingHelper
- Defined in:
- app/models/effective/datatables/trash.rb
Constant Summary
Constants included from EffectiveLoggingHelper
EffectiveLoggingHelper::ALLOWED_ATTRIBUTES, EffectiveLoggingHelper::ALLOWED_TAGS
Instance Method Summary collapse
-
#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.
Methods included from EffectiveLoggingHelper
#bootstrap_class_for_status, #effective_logging_object_link_to, #effective_logging_simple_format, #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
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/models/effective/datatables/trash.rb', line 32 def collection collection = Effective::Log.trash.includes(:user) if attributes[:user_id].present? collection = collection.where(user_id: attributes[:user_id]) end if attributes[:user].present? collection = collection.where(user: attributes[:user]) end if attributes[:associated_id] && attributes[:associated_type] collection = collection.where(associated_id: attributes[:associated_id], associated_type: attributes[:associated_type]) end collection end |