Sha256: f363f6e22f9213774a6820aee358b8d07d8a7c2f524c6ce4fd30eb433ae7e3be

Contents?: true

Size: 679 Bytes

Versions: 43

Compression:

Stored size: 679 Bytes

Contents

module Plutonium
  module Resource
    module Controllers
      module CrudActions
        module IndexAction
          extend ActiveSupport::Concern

          private

          def setup_index_action!
            @pagy, @resource_records = pagy filtered_resource_collection
          end

          def filtered_resource_collection
            query_params = current_definition
              .query_form.new(nil, query_object: current_query_object, page_size: nil)
              .extract_input(params)[:q]

            base_query = current_authorized_scope
            current_query_object.apply(base_query, query_params)
          end
        end
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
plutonium-0.15.7 lib/plutonium/resource/controllers/crud_actions/index_action.rb
plutonium-0.15.6 lib/plutonium/resource/controllers/crud_actions/index_action.rb
plutonium-0.15.5 lib/plutonium/resource/controllers/crud_actions/index_action.rb