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.1.5 app/models/participant.rb
event_calendar_engine-0.1.4 app/models/participant.rb
event_calendar_engine-0.1.3 app/models/participant.rb
event_calendar_engine-0.1.2 app/models/participant.rb
event_calendar_engine-0.1.1 app/models/participant.rb