Sha256: 00032390cd476e0b0bdc7918cf7471cd5ab6fa5297b26e5358971a7098285278
Contents?: true
Size: 645 Bytes
Versions: 27
Compression:
Stored size: 645 Bytes
Contents
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
27 entries across 27 versions & 1 rubygems