Class: Renalware::HD::PatientsWithUnmetPreferencesQuery
- Inherits:
-
Object
- Object
- Renalware::HD::PatientsWithUnmetPreferencesQuery
- Defined in:
- app/models/renalware/hd/patients_with_unmet_preferences_query.rb
Defined Under Namespace
Modules: Scopes
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(query = {}) ⇒ PatientsWithUnmetPreferencesQuery
constructor
A new instance of PatientsWithUnmetPreferencesQuery.
- #search ⇒ Object
Constructor Details
#initialize(query = {}) ⇒ PatientsWithUnmetPreferencesQuery
Returns a new instance of PatientsWithUnmetPreferencesQuery.
8 9 10 |
# File 'app/models/renalware/hd/patients_with_unmet_preferences_query.rb', line 8 def initialize(query = {}) @query = query end |
Instance Method Details
#call ⇒ Object
12 13 14 |
# File 'app/models/renalware/hd/patients_with_unmet_preferences_query.rb', line 12 def call search.result end |
#search ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'app/models/renalware/hd/patients_with_unmet_preferences_query.rb', line 16 def search HD::Patient .extend(Scopes) .includes(hd_profile: :hospital_unit) .includes(hd_preference_set: :hospital_unit) .eager_load(:hd_profile) .eager_load(:hd_preference_set) .having_an_unmet_preference .ransack(query) end |