From d381b800c4e9cbb6bf0042ad04387947c93d39a7 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Sun, 19 Jul 2015 14:32:25 +0300 Subject: [PATCH] Add associations to Track and Conference to Event --- app/models/event.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/event.rb b/app/models/event.rb index 2db7f8a..5c73365 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -1,6 +1,9 @@ class Event < ActiveRecord::Base include Proposable + has_one :track, through: :proposition, source: :proposition_accepting, source_type: Track + has_one :conference, through: :track + validates :title, presence: true validates :length, presence: true, numericality: {only_integer: true, greater_than: 0} validates :abstract, presence: true