[ADD]组织模块相关代码

This commit is contained in:
2021-01-11 17:44:11 +08:00
parent 178991b245
commit 2434ca9681
36 changed files with 655 additions and 1 deletions

View 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