class Event < ActiveRecord::Base include InputSanitization has_many :rsvps, :dependent => :destroy def Event.fresh find :all end def owner?(user) false end # We always store time value as UTC, but always present/accept value # as configured in uger.yaml. def time tz.utc_to_local(read_attribute('time')) end def time=(t) write_attribute('time', tz.local_to_utc(t)) end def utctime read_attribute('time') end def stale? utctime < Time.now.getutc end def tz Timezone.get(uger_config['timezone']) end end