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

.existing_event_typesObject



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

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

Instance Method Details

#participantsObject



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

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

#to_sObject



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

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