AutoCommit Fre Aug 7 01:03:02 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-08-07 01:03:02 +02:00
parent c6222cdc23
commit 13283e0e65
8 changed files with 26 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
class Survey::Question < ActiveRecord::Base
attr_accessible :text, :title, :typ, :choice_ids, :parent_type, :parent_id
belongs_to :parent, polymorphic: true
has_many :choices, dependent: :destroy
has_many :choices, dependent: :destroy, class_name: "Survey::Choice"
has_many :answers, through: :choices
include IsCommentable
FLAG_ICONS={"delete" => "fa fa-trash", "template"=> "ffi1-cleaning1"}
@@ -20,6 +20,7 @@ class Survey::Question < ActiveRecord::Base
self.choices.each do |c|
cpy.choices << c.copy_from_template
end
cpy
end
end