2018-05-07 16:47:29 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2021-02-20 09:57:27 -08:00
|
|
|
# == Schema Information
|
|
|
|
|
#
|
|
|
|
|
# Table name: schedules
|
|
|
|
|
#
|
|
|
|
|
# id :bigint not null, primary key
|
|
|
|
|
# created_at :datetime not null
|
|
|
|
|
# updated_at :datetime not null
|
|
|
|
|
# program_id :integer
|
|
|
|
|
# track_id :integer
|
|
|
|
|
#
|
|
|
|
|
# Indexes
|
|
|
|
|
#
|
|
|
|
|
# index_schedules_on_program_id (program_id)
|
|
|
|
|
# index_schedules_on_track_id (track_id)
|
|
|
|
|
#
|
2017-09-05 22:23:34 +03:00
|
|
|
class Schedule < ApplicationRecord
|
2016-07-08 13:28:02 +02:00
|
|
|
belongs_to :program
|
2017-08-09 18:12:20 +03:00
|
|
|
belongs_to :track
|
2016-07-08 13:28:02 +02:00
|
|
|
has_many :event_schedules, dependent: :destroy
|
2016-07-31 18:41:27 +02:00
|
|
|
has_many :events, through: :event_schedules
|
2016-08-18 00:32:16 +05:30
|
|
|
|
|
|
|
|
has_paper_trail ignore: [:updated_at], meta: { conference_id: :conference_id }
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def conference_id
|
|
|
|
|
program.conference_id
|
|
|
|
|
end
|
2016-07-08 13:28:02 +02:00
|
|
|
end
|