osem-fcy/app/models/qanswer.rb

21 lines
429 B
Ruby
Raw Normal View History

# 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
#
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
validates :question, :answer, presence: true
2014-02-09 18:05:57 +02:00
end