2020-11-23 15:35:03 +08:00
|
|
|
# == Schema Information
|
|
|
|
|
#
|
2021-06-25 17:31:23 +08:00
|
|
|
# Table name: forge_applied_projects
|
2020-11-23 15:35:03 +08:00
|
|
|
#
|
|
|
|
|
# id :integer not null, primary key
|
2021-06-25 17:31:23 +08:00
|
|
|
# project_id :integer
|
|
|
|
|
# user_id :integer
|
2020-11-23 15:35:03 +08:00
|
|
|
# role :integer default("0")
|
|
|
|
|
# status :integer default("0")
|
2021-06-25 17:31:23 +08:00
|
|
|
# created_at :datetime not null
|
|
|
|
|
# updated_at :datetime not null
|
|
|
|
|
#
|
|
|
|
|
# Indexes
|
|
|
|
|
#
|
|
|
|
|
# index_forge_applied_projects_on_project_id (project_id)
|
|
|
|
|
# index_forge_applied_projects_on_user_id (user_id)
|
2020-11-23 15:35:03 +08:00
|
|
|
#
|
|
|
|
|
|
2020-03-09 00:40:16 +08:00
|
|
|
class AppliedProject < ApplicationRecord
|
2021-06-17 16:37:48 +08:00
|
|
|
self.table_name = "forge_applied_projects"
|
2020-03-09 00:40:16 +08:00
|
|
|
belongs_to :user
|
|
|
|
|
belongs_to :project
|
|
|
|
|
|
|
|
|
|
has_many :applied_messages, as: :applied, dependent: :destroy
|
2021-06-08 14:56:43 +08:00
|
|
|
# has_many :forge_activities, as: :forge_act, dependent: :destroy
|
|
|
|
|
|
2021-06-09 16:53:09 +08:00
|
|
|
enum role: {manager: 3, developer: 4, reporter: 5}
|
2021-06-08 14:56:43 +08:00
|
|
|
enum status: {canceled: -1, common: 0, accepted: 1, refused: 2} # -1 已取消 0 待操作 1 已接收 2 已拒绝
|
2020-03-09 00:40:16 +08:00
|
|
|
|
|
|
|
|
end
|