Class: Renalware::HD::Scheduling::DiarySlot
Instance Attribute Summary collapse
-
#change_type ⇒ Object
Virtual attribute used on a form to determine what action as preformed on the slot.
-
#patient_ids ⇒ Object
Virtual to help the prepopulation of select2 with the offending patient if an error.
Class Method Summary
collapse
Instance Method Summary
collapse
#first_or_create_by!, #save_by, #save_by!, #update_by
Instance Attribute Details
#change_type ⇒ Object
Virtual attribute used on a form to determine what action as preformed on the slot
30
31
32
|
# File 'app/models/renalware/hd/scheduling/diary_slot.rb', line 30
def change_type
@change_type
end
|
#patient_ids ⇒ Object
Virtual to help the prepopulation of select2 with the offending patient if an error
32
33
34
|
# File 'app/models/renalware/hd/scheduling/diary_slot.rb', line 32
def patient_ids
@patient_ids
end
|
Class Method Details
.policy_class ⇒ Object
61
62
63
|
# File 'app/models/renalware/hd/scheduling/diary_slot.rb', line 61
def self.policy_class
DiaryPolicy
end
|
Instance Method Details
#cell_id ⇒ Object
82
83
84
|
# File 'app/models/renalware/hd/scheduling/diary_slot.rb', line 82
def cell_id
"#{diurnal_period_code&.id}-#{station&.id}-#{day_of_week}"
end
|
#day_of_week_name ⇒ Object
78
79
80
|
# File 'app/models/renalware/hd/scheduling/diary_slot.rb', line 78
def day_of_week_name
Time::DAYS_INTO_WEEK.keys[day_of_week - 1].capitalize
end
|
#description ⇒ Object
69
70
71
72
73
74
75
76
|
# File 'app/models/renalware/hd/scheduling/diary_slot.rb', line 69
def description
period = diurnal_period_code.code.upcase if diary.master
"Recurring every #{day_of_week_name} #{period}"
else
"This week only on #{day_of_week_name} #{period}"
end
end
|
#on_master_diary? ⇒ Boolean
65
66
67
|
# File 'app/models/renalware/hd/scheduling/diary_slot.rb', line 65
def on_master_diary?
diary&.master?
end
|