Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop

This commit is contained in:
2024-05-07 14:08:56 +08:00
18 changed files with 53 additions and 21 deletions

View File

@@ -28,7 +28,7 @@ class Page < ApplicationRecord
belongs_to :project
# language_frame 前端语言框架
enum language_frame: { hugo: 0, jekyll: 1, hexo: 2}
enum language_frame: { hugo: 0, jekyll: 1, hexo: 2, files: 3}
after_create do
PageService.genernate_user(user_id)

View File

@@ -13,7 +13,7 @@
#
class PageTheme < ApplicationRecord
enum language_frame: { hugo: 0, jeklly: 1, hexo: 2}
enum language_frame: { hugo: 0, jeklly: 1, hexo: 2, files:3}
validates :name, presence: {message: "主题名不能为空"}, uniqueness: {message: "主题名已存在",scope: :language_frame},length: {maximum: 255}
def image

View File

@@ -90,6 +90,8 @@ class Project < ApplicationRecord
include ProjectOperable
include Dcodes
default_scope {where.not(id: 0)}
# common:开源托管项目
# mirror:普通镜像项目,没有定时同步功能
# sync_mirror:同步镜像项目,有系统定时同步功能,且用户可手动同步操作

View File

@@ -23,6 +23,7 @@ class ProjectUnit < ApplicationRecord
def self.init_types(project_id, project_type='common')
unit_types = project_type == 'sync_mirror' ? ProjectUnit::unit_types.except("pulls") : ProjectUnit::unit_types
unit_types = unit_types.except("dataset")
unit_types.each do |_, v|
self.create!(project_id: project_id, unit_type: v)
end