Sha256: d01dedb031d59c36a2dbdd2f02528a5d452e7e2ff592e9abf1160320e5a475c2

Contents?: true

Size: 473 Bytes

Versions: 25

Compression:

Stored size: 473 Bytes

Contents

module Participant
  @@types ||= []
  
  def self.included(base)
    return if @@types.include?(base)
    
    @@types << base
    
    base.instance_eval do
      include Associations
    end
  end
  def self.types
    @@types.sort
  end
  
  module Associations
    def self.included(base)
      base.instance_eval do
        has_many :attendees, {:as => :participant, :dependent => :destroy}
        has_many :events, {:through => :attendees}
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
event_calendar_engine-0.2.15 app/models/participant.rb
event_calendar_engine-0.2.14 app/models/participant.rb
event_calendar_engine-0.2.13 app/models/participant.rb
event_calendar_engine-0.2.11 app/models/participant.rb
event_calendar_engine-0.2.10 app/models/participant.rb
event_calendar_engine-0.2.8 app/models/participant.rb
event_calendar_engine-0.2.7 app/models/participant.rb
event_calendar_engine-0.2.6 app/models/participant.rb
event_calendar_engine-0.2.5 app/models/participant.rb
event_calendar_engine-0.2.4 app/models/participant.rb
event_calendar_engine-0.2.3 app/models/participant.rb
event_calendar_engine-0.2.2 app/models/participant.rb
event_calendar_engine-0.2.1 app/models/participant.rb
event_calendar_engine-0.2.0 app/models/participant.rb
event_calendar_engine-0.1.11 app/models/participant.rb
event_calendar_engine-0.1.10 app/models/participant.rb
event_calendar_engine-0.1.9 app/models/participant.rb
event_calendar_engine-0.1.8 app/models/participant.rb
event_calendar_engine-0.1.7 app/models/participant.rb
event_calendar_engine-0.1.6 app/models/participant.rb