add column use_blockchain

This commit is contained in:
nigel007 2020-12-30 16:24:32 +08:00
parent 99b631ced3
commit 904ac86c86
1 changed files with 4 additions and 1 deletions

View File

@ -52,6 +52,7 @@
# open_devops_count :integer default("0")
# recommend :boolean default("0")
# platform :integer default("0")
# use_blockchain :boolean default("0")
#
# Indexes
#
@ -68,6 +69,8 @@
# index_projects_on_updated_on (updated_on)
#
class Project < ApplicationRecord
include Matchable
include Publicable
@ -108,7 +111,7 @@ class Project < ApplicationRecord
has_one :project_detail, dependent: :destroy
after_save :check_project_members
scope :project_statics_select, -> {select(:id,:name, :is_public, :identifier, :status, :project_type, :user_id, :forked_count, :visits, :project_category_id, :project_language_id, :license_id, :ignore_id, :watchers_count, :created_on)}
scope :project_statics_select, -> {select(:id,:name, :is_public, :identifier, :status, :project_type, :user_id, :forked_count, :visits, :project_category_id, :project_language_id, :license_id, :ignore_id, :watchers_count, :created_on, :use_blockchain)}
scope :no_anomory_projects, -> {where("projects.user_id is not null and projects.user_id != ?", 2)}
scope :recommend, -> { visible.project_statics_select.where(recommend: true) }