Sha256: 625fdf5be10d6498e79334402ec0313545d99078a3d7f55f1f6a9d1218903a9b
Contents?: true
Size: 630 Bytes
Versions: 27
Compression:
Stored size: 630 Bytes
Contents
require_dependency "renalware/patients" module Renalware module Patients class WorryQuery attr_reader :query_params def initialize(query_params) @query_params = query_params @query_params[:s] = "date_time DESC" if @query_params[:s].blank? end def call search .result .includes(:created_by, patient: { current_modality: [:description] }) .order(created_at: :asc) .page(query_params[:page]) .per(query_params[:per_page]) end def search @search ||= Worry.ransack(query_params) end end end end
Version data entries
27 entries across 27 versions & 1 rubygems