You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trustieforge/app/models/join_in_competition.rb

11 lines
356 B

# 新竞赛参加关系表
class JoinInCompetition < ActiveRecord::Base
attr_accessible :competition_id, :user_id
belongs_to :user, :class_name => "User", :foreign_key => :user_id
belongs_to :competition, :class_name => "Contest", :foreign_key => :competition_id
validates :user_id, presence: true
validates :competition_id, presence: true
end