|
|
|
@@ -55,14 +55,13 @@ |
|
|
|
# default_branch :string(255) default("master") |
|
|
|
# website :string(255) |
|
|
|
# lesson_url :string(255) |
|
|
|
# use_blockchain :boolean default("0") |
|
|
|
# is_pinned :boolean default("0") |
|
|
|
# recommend_index :integer default("0") |
|
|
|
# use_blockchain :boolean default("0") |
|
|
|
# pr_view_admin :boolean default("0") |
|
|
|
# |
|
|
|
# Indexes |
|
|
|
# |
|
|
|
# index_projects_on_forked_count (forked_count) |
|
|
|
# index_projects_on_forked_from_project_id (forked_from_project_id) |
|
|
|
# index_projects_on_identifier (identifier) |
|
|
|
# index_projects_on_invite_code (invite_code) |
|
|
|
@@ -72,7 +71,6 @@ |
|
|
|
# index_projects_on_license_id (license_id) |
|
|
|
# index_projects_on_name (name) |
|
|
|
# index_projects_on_platform (platform) |
|
|
|
# index_projects_on_praises_count (praises_count) |
|
|
|
# index_projects_on_project_category_id (project_category_id) |
|
|
|
# index_projects_on_project_language_id (project_language_id) |
|
|
|
# index_projects_on_project_type (project_type) |
|
|
|
@@ -80,7 +78,6 @@ |
|
|
|
# index_projects_on_rgt (rgt) |
|
|
|
# index_projects_on_status (status) |
|
|
|
# index_projects_on_updated_on (updated_on) |
|
|
|
# index_projects_on_user_id (user_id) |
|
|
|
# |
|
|
|
|
|
|
|
class Project < ApplicationRecord |
|
|
|
@@ -138,6 +135,7 @@ class Project < ApplicationRecord |
|
|
|
has_many :commit_logs, dependent: :destroy |
|
|
|
has_many :daily_project_statistics, dependent: :destroy |
|
|
|
has_one :project_dataset, dependent: :destroy |
|
|
|
has_many :sync_repositories, dependent: :destroy |
|
|
|
after_create :incre_user_statistic, :incre_platform_statistic |
|
|
|
after_save :check_project_members |
|
|
|
before_save :set_invite_code, :reset_unmember_followed, :set_recommend_and_is_pinned, :reset_cache_data |
|
|
|
|