Newer
Older
dmpopidor / app / models / static_page_content.rb
@Quentin SONREL Quentin SONREL on 20 Jan 2020 658 bytes Added structured schema/answers models and tables
# == Schema Information
#
# Table name: static_page_contents
#
#  id             :integer          not null, primary key
#  title          :string
#  content        :text
#  static_page_id :integer          not null
#  language_id    :integer          not null
#  created_at     :datetime         not null
#  updated_at     :datetime         not null
#
# Indexes
#
#  index_static_page_contents_on_language_id     (language_id)
#  index_static_page_contents_on_static_page_id  (static_page_id)
#

class StaticPageContent < ActiveRecord::Base
  belongs_to :static_page
  belongs_to :language

  validates :language, uniqueness: { scope: :static_page_id }
end