aboutsummaryrefslogtreecommitdiff
blob: f15167fa34ee4d04b22b26794641b14382f803fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'permissions/inherit.rb'
class QuestionContentMultipleChoice < ActiveRecord::Base

  hobo_model # Don't put anything above this

  fields do
    content   :text
    timestamps
  end

  belongs_to      :question
  attr_readonly   :question
  has_many        :options, :as => :option_owner, :accessible => true, :uniq => true

  inherit_permissions(:question)

  def new_answer_of(user)
    MultipleChoiceAnswer.new :question_id => question_id, :owner => user
  end
end