BikeBikeBike/app/models/conference.rb

22 lines
713 B
Ruby
Raw Normal View History

2014-03-09 14:43:33 -06:00
class Conference < ActiveRecord::Base
mount_uploader :cover, CoverUploader
mount_uploader :poster, PosterUploader
belongs_to :conference_type
has_many :conference_host_organizations, :dependent => :destroy
has_many :organizations, :through => :conference_host_organizations
has_many :conference_registration_form_fields, :order => 'position ASC', :dependent => :destroy#, :class_name => '::ConferenceRegistrationFormField'
has_many :registration_form_fields, :through => :conference_registration_form_fields
2014-03-23 13:31:08 -06:00
has_many :workshops
2014-03-09 14:43:33 -06:00
accepts_nested_attributes_for :conference_host_organizations, :reject_if => proc {|u| u[:organization_id].blank?}, :allow_destroy => true
def to_param
slug
end
end