User/Person models merge

This commit is contained in:
Stella Rouzi 2014-06-23 19:07:50 +03:00
parent 66b84e3660
commit 23bf55b66c
80 changed files with 1064 additions and 1221 deletions

View file

@ -1,5 +1,5 @@
class Registration < ActiveRecord::Base
belongs_to :person
belongs_to :user
belongs_to :conference
belongs_to :dietary_choice
@ -10,27 +10,21 @@ class Registration < ActiveRecord::Base
has_and_belongs_to_many :qanswers
has_and_belongs_to_many :vchoices
attr_accessible :person_id, :conference_id, :attending_social_events, :attending_with_partner,
:using_affiliated_lodging, :arrival, :departure, :person_attributes, :other_dietary_choice, :dietary_choice_id,
attr_accessible :user_id, :conference_id, :attending_social_events, :attending_with_partner,
:using_affiliated_lodging, :arrival, :departure, :user_attributes, :other_dietary_choice, :dietary_choice_id,
:handicapped_access_required, :supporter_registration_attributes, :social_event_ids, :other_special_needs,
:event_ids, :attended, :volunteer, :vchoice_ids,
:qanswer_ids, :qanswers_attributes
accepts_nested_attributes_for :person
accepts_nested_attributes_for :user
accepts_nested_attributes_for :supporter_registration
accepts_nested_attributes_for :social_events
accepts_nested_attributes_for :qanswers
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
delegate :mobile, :to => :person
delegate :languages, :to => :person
delegate :volunteer_experience, :to => :person
delegate :tshirt, :to => :person
delegate :name, :to => :user
delegate :email, :to => :user
delegate :nickname, :to => :user
delegate :affiliation, :to => :user
alias_attribute :other_needs, :other_special_needs