Module: ActiveAdminScopedCollectionActions::Controller

Defined in:
lib/active_admin_scoped_collection_actions/controller.rb

Constant Summary collapse

COLLECTION_APPLIES =
[
  :authorization_scope,
  :filtering,
  :scoping,
  :includes,
].freeze

Instance Method Summary collapse

Instance Method Details

#scoped_collection_recordsObject



10
11
12
13
14
# File 'lib/active_admin_scoped_collection_actions/controller.rb', line 10

def scoped_collection_records
  selection = params.fetch(:collection_selection, [])
  selection.any? ? batch_action_collection(COLLECTION_APPLIES).where(resource_class.primary_key => selection)
    : batch_action_collection(COLLECTION_APPLIES)
end