Completed
Push — master ( b32d12...ddb69c )
by
unknown
02:17
created

Event.reset_current()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 3
rs 10
cc 1
1
class Event < ActiveRecord::Base
2
  has_many :sessions, dependent: :destroy
3
  has_many :timeslots, dependent: :destroy
4
  has_many :rooms, dependent: :destroy
5
6
  has_many :presenter_timeslot_restrictions, :through => :timeslots
7
8
  # Careful! Large joins here; use with caution:
9
  has_many :attendances, through: :sessions
10
  has_many :participants, through: :attendances
11
12
  validates_presence_of :name, :date
13
14
  def self.current_event(opts = {})
15
    Event.order(:date).last
16
  end
17
end
18