Sha256: 38b283713d48607977009caa3113ebeb3c7f13b43ef42c25ea934af75f3b8516
Contents?: true
Size: 671 Bytes
Versions: 98
Compression:
Stored size: 671 Bytes
Contents
# frozen_string_literal: true module Renalware module Transplants class LiveDonorsQuery include ModalityScopes DEFAULT_ORDER = %w(family_name given_name).freeze def initialize(q = {}) @q = q end def call search.result end def search @search ||= begin relation.ransack(q).tap do |search| search.sorts = DEFAULT_ORDER end end end private def relation Patient .all .extending(ModalityScopes) .with_current_modality_of_class(DonorModalityDescription) end attr_reader :q end end end
Version data entries
98 entries across 98 versions & 1 rubygems