Introduce an association for the selected_schedule

Association in Program fot the selected_schedule
This commit is contained in:
Ana 2016-07-28 12:50:32 +02:00
parent 3f114629f9
commit beb17165a2
10 changed files with 24 additions and 21 deletions

View file

@ -270,7 +270,7 @@ class Event < ActiveRecord::Base
# returns the event_schedule for this event and for the selected_schedule
def selected_event_schedule
event_schedules.find_by(schedule_id: program.try(:selected_schedule))
event_schedules.find_by(schedule_id: program.try(:selected_schedule_id))
end
private