forgeplus/app/models/project_topic_ralate.rb

27 lines
633 B
Ruby

# == Schema Information
#
# Table name: project_topic_ralates
#
# id :integer not null, primary key
# project_topic_id :integer
# project_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_project_topic_ralates_on_project_id (project_id)
# index_project_topic_ralates_on_project_topic_id (project_topic_id)
#
class ProjectTopicRalate < ApplicationRecord
belongs_to :project_topic, counter_cache: :projects_count
belongs_to :project
validates :project_id, uniqueness: { scope: :project_topic_id }
end