Sha256: 3e136d19c793f073d81d4ac25571f133aa68e9b1615c950b2859cfece8f2f067

Contents?: true

Size: 460 Bytes

Versions: 4

Compression:

Stored size: 460 Bytes

Contents

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

    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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
active_admin_scoped_collection_actions-1.0.1 lib/active_admin_scoped_collection_actions/controller.rb
active_admin_scoped_collection_actions-0.4.1 lib/active_admin_scoped_collection_actions/controller.rb
active_admin_scoped_collection_actions-0.4.0 lib/active_admin_scoped_collection_actions/controller.rb
active_admin_scoped_collection_actions-0.3.5 lib/active_admin_scoped_collection_actions/controller.rb