Class: Effective::Datatables::Trash
- Inherits:
-
Effective::Datatable
- Object
- Effective::Datatable
- Effective::Datatables::Trash
- Includes:
- EffectiveTrashHelper
- Defined in:
- app/models/effective/datatables/trash.rb
Constant Summary
Constants included from EffectiveTrashHelper
EffectiveTrashHelper::ALLOWED_ATTRIBUTES, EffectiveTrashHelper::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 trash.
Methods included from EffectiveTrashHelper
#effective_trash_simple_format, #format_trash_details_value, #render_trash, #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 trash
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::Trash.all.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[:trashed_id] && attributes[:trashed_type] collection = collection.where(trashed_id: attributes[:trashed_id], trashed_type: attributes[:trashed_type]) end collection end |