osem-fcy/app/models/qanswer.rb

10 lines
237 B
Ruby

class Qanswer < ActiveRecord::Base
attr_accessible :question_id, :answer_id
belongs_to :question
belongs_to :answer, dependent: :delete
has_and_belongs_to_many :registrations
validates :question, :answer, presence: true
end