Class: Renalware::Pathology::RequestForPatientRequestDescriptionQuery
- Inherits:
-
Object
- Object
- Renalware::Pathology::RequestForPatientRequestDescriptionQuery
- Defined in:
- app/models/renalware/pathology/request_for_patient_request_description_query.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(patient, request_description) ⇒ RequestForPatientRequestDescriptionQuery
constructor
A new instance of RequestForPatientRequestDescriptionQuery.
Constructor Details
#initialize(patient, request_description) ⇒ RequestForPatientRequestDescriptionQuery
Returns a new instance of RequestForPatientRequestDescriptionQuery.
8 9 10 11 |
# File 'app/models/renalware/pathology/request_for_patient_request_description_query.rb', line 8 def initialize(patient, request_description) @patient = patient @request_description = Renalware::Pathology::RequestDescription.find(request_description.id) end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/models/renalware/pathology/request_for_patient_request_description_query.rb', line 13 def call @patient .requests .joins(:request_descriptions) .where( pathology_request_descriptions_requests_requests: { request_description_id: @request_description.id } ) .order(created_at: :desc) .first end |