Class: Event

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
ActionView::Helpers::TextHelper, EventInstanceMethods
Defined in:
app/models/event.rb

Instance Attribute Summary collapse

Attributes included from EventInstanceMethods

#end_date, #end_time, #start_date, #start_time

Class Method Summary collapse

Instance Method Summary collapse

Methods included from EventInstanceMethods

#date, #end_day, #end_hour, #end_min, #end_month, #end_year, #multi_day_date, #one_day?, #one_day_date, #start_day, #start_hour, #start_min, #start_month, #start_year

Instance Attribute Details

#adjust_to_utcObject

Returns the value of attribute adjust_to_utc.



4
5
6
# File 'app/models/event.rb', line 4

def adjust_to_utc
  @adjust_to_utc
end

Class Method Details

.event_typesObject



58
59
60
# File 'app/models/event.rb', line 58

def self.event_types
  existing_event_types.map(&:event_type).reject { |ev| ev.blank? }.sort
end

Instance Method Details

#participantsObject



62
63
64
65
66
67
# File 'app/models/event.rb', line 62

def participants
  return [] if attendees.count == 0
  attendees.all.collect do |attendee|
    attendee.participant
  end
end

#to_sObject



69
70
71
# File 'app/models/event.rb', line 69

def to_s
  "#{name} (#{start_on} #{end_on ? ' - ' + end_on.to_s : ''})"
end