AutoCommit Don Aug 27 15:03:02 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-08-27 15:03:02 +02:00
parent 370c439c29
commit 7c2f1f9753
10 changed files with 26 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
class Survey::Answer < ActiveRecord::Base
belongs_to :choice, class_name: 'Survey::Choice'
belongs_to :choice, class_name: 'Survey::Choice', touch: true
belongs_to :user
# attr_accessible :title, :body
end

View File

@@ -1,5 +1,5 @@
class Survey::Choice < ActiveRecord::Base
belongs_to :question, class_name: 'Survey::Question'
belongs_to :question, class_name: 'Survey::Question', touch: true
attr_accessible :picture, :sort, :text, :icon, :picture_cache, :remove_picture, :question_id
has_many :answers, class_name: 'Survey::Answer', dependent: :destroy
include ActionView::Helpers::TagHelper

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
class Survey::Question < ActiveRecord::Base
attr_accessible :text, :title, :typ, :choice_ids, :parent_type, :parent_id
belongs_to :parent, polymorphic: true
belongs_to :parent, polymorphic: true, touch: true
has_many :choices, dependent: :destroy, class_name: "Survey::Choice"
has_many :answers, through: :choices
include IsCommentable