Sha256: 05cc94d8e9468135b23e78d32179dd441ae4fd1a3110158304f325952eebe607
Contents?: true
Size: 676 Bytes
Versions: 21
Compression:
Stored size: 676 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/letters" module Renalware module Letters module QueryableLetter def finder_needs_type_condition? false end def ransackable_scopes(_auth_object = nil) %i(state_eq) end def state_eq(state = :draft) where(type: Letter.state_class_name(state)) end end class LetterQuery def initialize(q: nil) @q = q || {} @q[:s] ||= ["issued_on desc"] end def call search.result end def search @search ||= Letter.extend(QueryableLetter).includes(:event).search(@q) end end end end
Version data entries
21 entries across 21 versions & 1 rubygems