Adding social events, which can be used on the registration page

This commit is contained in:
Matt Barringer 2013-02-16 13:30:53 +01:00
parent ba721772b9
commit 3933e89a9c
14 changed files with 112 additions and 6 deletions

View file

@ -1,13 +1,14 @@
class Conference < ActiveRecord::Base
attr_accessible :title, :short_title, :social_tag, :contact_email, :timezone, :html_export_path,
:start_date, :end_date, :rooms_attributes, :tracks_attributes, :dietary_choices_attributes,
:use_dietary_choices, :use_supporter_levels, :supporter_levels_attributes,
:use_dietary_choices, :use_supporter_levels, :supporter_levels_attributes, :social_events_attributes,
:event_types_attributes, :registration_start_date, :registration_end_date, :logo
has_paper_trail
has_one :email_settings, :dependent => :destroy
has_one :call_for_papers, :dependent => :destroy
has_many :social_events, :dependent => :destroy
has_many :supporter_registrations, :dependent => :destroy
has_many :supporter_levels, :dependent => :destroy
has_many :dietary_choices, :dependent => :destroy
@ -21,6 +22,7 @@ class Conference < ActiveRecord::Base
accepts_nested_attributes_for :rooms, :reject_if => proc {|r| r["name"].blank?}, :allow_destroy => true
accepts_nested_attributes_for :tracks, :reject_if => proc {|r| r["name"].blank?}, :allow_destroy => true
accepts_nested_attributes_for :social_events, :allow_destroy => true
accepts_nested_attributes_for :venue
accepts_nested_attributes_for :dietary_choices, :allow_destroy => true
accepts_nested_attributes_for :supporter_levels, :allow_destroy => true

View file

@ -4,11 +4,13 @@ class Registration < ActiveRecord::Base
belongs_to :dietary_choice
has_one :supporter_registration
has_and_belongs_to_many :social_events
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,
:handicapped_access_required, :supporter_registration_attributes
:handicapped_access_required, :supporter_registration_attributes, :social_event_ids, :other_special_needs
accepts_nested_attributes_for :person
accepts_nested_attributes_for :supporter_registration
accepts_nested_attributes_for :social_events
end

View file

@ -0,0 +1,6 @@
class SocialEvent < ActiveRecord::Base
attr_accessible :title, :description, :date
belongs_to :conference
has_and_belongs_to_many :registrations
end