class SuggestedMeaning < ApplicationRecord
  belongs_to :entry
  belongs_to :submitted_by, class_name: "User"
  belongs_to :reviewed_by, class_name: "User", optional: true
  belongs_to :language,
             class_name: "SupportedLanguage",
             foreign_key: :language_code,
             primary_key: :code

  enum :status, %i[pending accepted rejected]

  validates :language_code, presence: true
  validates :alternative_translation, presence: true
end
