Add schedule interval as attribute of a program

Also, the part of the schedule event is deleted and the length of the event types
changes to the nearest suitable after changing the length of the interval.

This closes #1220
This commit is contained in:
JewelSam 2017-03-02 20:53:20 +03:00
parent d1bf19867c
commit f6e74461ba
19 changed files with 104 additions and 35 deletions

View file

@ -26,6 +26,6 @@ class EventSerializer < ActiveModel::Serializer
end
def length
object.event_type.try(:length) || EventType::LENGTH_STEP
object.event_type.try(:length) || object.event_type.program.schedule_interval
end
end