AutoCommit Don Jul 30 00:03:02 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-07-30 00:03:02 +02:00
parent 068c2a2e55
commit 97df081b33
66 changed files with 1542 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
class Survey::Question < ActiveRecord::Base
attr_accessible :text, :title, :typ, :choice_ids
belongs_to :parent, polymorphic: true
has_many :choices
has_many :answers, through: :choices
def add_yesno_choices
c=Survey::Choice.new(title: "Ja")
c.save
this.choices << c
c=Survey::Choice.new(title: "Nein")
c.save
this.choices << c
end
end