Added target for surveys.
This commit is contained in:
parent
157a16d8f2
commit
9ce4ba6f6b
6 changed files with 12 additions and 15 deletions
|
|
@ -36,7 +36,7 @@ class Conference < ActiveRecord::Base
|
|||
has_many :subscriptions, dependent: :destroy
|
||||
has_many :surveys, as: :surveyable, dependent: :destroy do
|
||||
def for_registration
|
||||
where(target: targets[:registration])
|
||||
where(target: targets[:during_registration])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ class Survey < ActiveRecord::Base
|
|||
belongs_to :surveyable, polymorphic: true
|
||||
has_many :survey_questions
|
||||
|
||||
enum target: [:conference, :registration]
|
||||
|
||||
enum target: [:after_conference, :during_registration]
|
||||
validates :title, presence: true
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue