2013-01-07 09:04:09 +01:00
|
|
|
class Registration < ActiveRecord::Base
|
|
|
|
|
belongs_to :person
|
|
|
|
|
belongs_to :conference
|
2013-02-02 16:43:47 +01:00
|
|
|
belongs_to :dietary_choice
|
|
|
|
|
|
|
|
|
|
has_one :supporter_registration
|
2013-07-15 13:11:18 +03:00
|
|
|
has_one :supporter_level, :through => :supporter_registration
|
2013-02-16 13:30:53 +01:00
|
|
|
has_and_belongs_to_many :social_events
|
2013-07-11 07:47:05 +03:00
|
|
|
has_and_belongs_to_many :events
|
2013-01-07 09:04:09 +01:00
|
|
|
|
2013-02-06 20:26:41 +01:00
|
|
|
attr_accessible :person_id, :conference_id, :attending_social_events, :attending_with_partner,
|
2013-02-02 16:43:47 +01:00
|
|
|
:using_affiliated_lodging, :arrival, :departure, :person_attributes, :other_dietary_choice, :dietary_choice_id,
|
2013-07-11 07:43:52 +03:00
|
|
|
:handicapped_access_required, :supporter_registration_attributes, :social_event_ids, :other_special_needs,
|
2013-07-12 10:24:51 +03:00
|
|
|
:event_ids, :attended
|
2013-01-07 09:04:09 +01:00
|
|
|
|
2013-02-02 16:43:47 +01:00
|
|
|
accepts_nested_attributes_for :person
|
|
|
|
|
accepts_nested_attributes_for :supporter_registration
|
2013-02-16 13:30:53 +01:00
|
|
|
accepts_nested_attributes_for :social_events
|
2013-07-16 09:47:23 +02:00
|
|
|
|
|
|
|
|
delegate :first_name, :to => :person
|
|
|
|
|
delegate :last_name, :to => :person
|
|
|
|
|
delegate :public_name, :to => :person
|
|
|
|
|
delegate :email, :to => :person
|
|
|
|
|
delegate :irc_nickname, :to => :person
|
|
|
|
|
delegate :company, :to => :person
|
2013-07-12 10:45:40 +03:00
|
|
|
|
|
|
|
|
alias_attribute :with_partner, :attending_with_partner
|
|
|
|
|
alias_attribute :need_access, :handicapped_access_required
|
|
|
|
|
alias_attribute :other_needs, :other_special_needs
|
2013-07-15 16:07:23 +02:00
|
|
|
end
|