Merge branch 'adding_surveys' of https://github.com/mdeniz/osem into mdeniz-adding_surveys

This commit is contained in:
Henne Vogelsang 2016-07-01 10:32:07 +02:00
commit 1991f53f26
40 changed files with 694 additions and 33 deletions

View file

@ -34,6 +34,11 @@ class Conference < ActiveRecord::Base
has_many :campaigns, dependent: :destroy
has_many :commercials, as: :commercialable, dependent: :destroy
has_many :subscriptions, dependent: :destroy
has_many :surveys, as: :surveyable, dependent: :destroy do
def for_registration
where(target: targets[:during_registration])
end
end
accepts_nested_attributes_for :venue
accepts_nested_attributes_for :tickets, allow_destroy: true