2020-03-09 00:40:16 +08:00
|
|
|
class Member < ApplicationRecord
|
|
|
|
belongs_to :user
|
2020-04-23 11:08:29 +08:00
|
|
|
# belongs_to :course, optional: true
|
2020-03-09 00:40:16 +08:00
|
|
|
belongs_to :project, optional: true
|
|
|
|
|
|
|
|
has_many :member_roles, dependent: :destroy
|
|
|
|
has_many :roles, through: :member_roles
|
|
|
|
|
|
|
|
validates :user_id, :project_id, presence: true
|
|
|
|
|
|
|
|
end
|