Class: Workarea::BulkActionSelections
- Inherits:
-
Object
- Object
- Workarea::BulkActionSelections
- Defined in:
- app/queries/workarea/bulk_action_selections.rb
Instance Attribute Summary collapse
-
#bulk_action ⇒ Object
readonly
Returns the value of attribute bulk_action.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(id, params = {}) ⇒ BulkActionSelections
constructor
A new instance of BulkActionSelections.
- #results ⇒ Object
Constructor Details
#initialize(id, params = {}) ⇒ BulkActionSelections
Returns a new instance of BulkActionSelections.
5 6 7 8 |
# File 'app/queries/workarea/bulk_action_selections.rb', line 5 def initialize(id, params = {}) @bulk_action = BulkAction.find(id) @params = params end |
Instance Attribute Details
#bulk_action ⇒ Object (readonly)
Returns the value of attribute bulk_action.
3 4 5 |
# File 'app/queries/workarea/bulk_action_selections.rb', line 3 def bulk_action @bulk_action end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'app/queries/workarea/bulk_action_selections.rb', line 3 def params @params end |
Instance Method Details
#results ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'app/queries/workarea/bulk_action_selections.rb', line 10 def results @results ||= if bulk_action.ids.any? models = find_from_global_ids(bulk_action.ids) PagedArray.from(models, 1, models.size, models.size) else bulk_action.admin_query.class.new(query_params).results end end |