2018-05-07 16:47:29 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2021-02-20 09:57:27 -08:00
|
|
|
# == Schema Information
|
|
|
|
|
#
|
|
|
|
|
# Table name: qanswers
|
|
|
|
|
#
|
|
|
|
|
# id :bigint not null, primary key
|
|
|
|
|
# created_at :datetime
|
|
|
|
|
# updated_at :datetime
|
|
|
|
|
# answer_id :integer
|
|
|
|
|
# question_id :integer
|
|
|
|
|
#
|
2017-09-05 22:23:34 +03:00
|
|
|
class Qanswer < ApplicationRecord
|
2014-02-09 18:05:57 +02:00
|
|
|
belongs_to :question
|
2014-07-21 14:49:05 +02:00
|
|
|
belongs_to :answer, dependent: :delete
|
2014-08-18 21:26:45 +03:00
|
|
|
|
2014-02-09 18:05:57 +02:00
|
|
|
has_and_belongs_to_many :registrations
|
2014-11-09 18:25:36 +02:00
|
|
|
|
|
|
|
|
validates :question, :answer, presence: true
|
2014-02-09 18:05:57 +02:00
|
|
|
end
|