gravier_app/app/models/question_set.rb
2017-09-21 12:37:53 +02:00

18 lines
436 B
Ruby

# -*- encoding : utf-8 -*-
class QuestionSet < ActiveRecord::Base
belongs_to :survey_item
belongs_to :survey_set
#attr_accessible :answer_sets_attributes, :survey_item, :survey_item_id, :boolean_content, :content
has_many :answer_sets, :dependent => :destroy
accepts_nested_attributes_for :answer_sets
scope :dont_answered, -> {
includes(:answer_sets).where("answer_sets.is_checked == ?", false)
}
end