for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
class Event < ActiveRecord::Base
has_many :sessions, dependent: :destroy
has_many :timeslots, dependent: :destroy
has_many :rooms, dependent: :destroy
has_many :presenter_timeslot_restrictions, :through => :timeslots
# Careful! Large joins here; use with caution:
has_many :attendances, through: :sessions
has_many :participants, through: :attendances
validates_presence_of :name, :date
def self.current_event(opts = {})
Event.order(:date).last
end