Class: Renalware::HD::Diary
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Renalware::HD::Diary
- Includes:
- Accountable
- Defined in:
- app/models/renalware/hd/diary.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#slot_for(diurnal_period_code_id, station_id, day_of_week) ⇒ Object
Searchs the object graph rather than a SQL search.
Methods included from Accountable
#first_or_create_by!, #save_by, #save_by!, #update_by
Class Method Details
.policy_class ⇒ Object
27 28 29 |
# File 'app/models/renalware/hd/diary.rb', line 27 def self.policy_class DiaryPolicy end |
Instance Method Details
#slot_for(diurnal_period_code_id, station_id, day_of_week) ⇒ Object
Searchs the object graph rather than a SQL search
32 33 34 35 36 37 38 |
# File 'app/models/renalware/hd/diary.rb', line 32 def slot_for(diurnal_period_code_id, station_id, day_of_week) slots.find do |slot| slot.diurnal_period_code_id == diurnal_period_code_id && slot.station_id == station_id && slot.day_of_week == day_of_week end end |