mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-20 11:45:57 +08:00
[ADD]组织模块相关代码
This commit is contained in:
36
app/models/organization_extension.rb
Normal file
36
app/models/organization_extension.rb
Normal file
@@ -0,0 +1,36 @@
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: organization_extensions
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# organization_id :integer
|
||||
# description :string(255)
|
||||
# website :string(255)
|
||||
# location :string(255)
|
||||
# repo_admin_change_team_access :boolean default("0")
|
||||
# visibility :integer default("0")
|
||||
# max_repo_creation :integer default("-1")
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_organization_extensions_on_organization_id (organization_id)
|
||||
#
|
||||
|
||||
class OrganizationExtension < ApplicationRecord
|
||||
|
||||
belongs_to :organization
|
||||
|
||||
enum visibility: {common: 0, limited: 1, privacy: 2}
|
||||
|
||||
def self.build(organization_id, description, website, location, repo_admin_change_team_access, visibility, max_repo_creation)
|
||||
self.create!(organization_id: organization_id,
|
||||
description: description,
|
||||
website: website,
|
||||
location: location,
|
||||
repo_admin_change_team_access: repo_admin_change_team_access,
|
||||
visibility: visibility,
|
||||
max_repo_creation: max_repo_creation)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user