Add associations to Track and Conference to Event
This commit is contained in:
parent
0ece79a8ae
commit
d381b800c4
|
@ -1,6 +1,9 @@
|
||||||
class Event < ActiveRecord::Base
|
class Event < ActiveRecord::Base
|
||||||
include Proposable
|
include Proposable
|
||||||
|
|
||||||
|
has_one :track, through: :proposition, source: :proposition_accepting, source_type: Track
|
||||||
|
has_one :conference, through: :track
|
||||||
|
|
||||||
validates :title, presence: true
|
validates :title, presence: true
|
||||||
validates :length, presence: true, numericality: {only_integer: true, greater_than: 0}
|
validates :length, presence: true, numericality: {only_integer: true, greater_than: 0}
|
||||||
validates :abstract, presence: true
|
validates :abstract, presence: true
|
||||||
|
|
Loading…
Reference in New Issue