修复搜索报错的问题

This commit is contained in:
sylor_huang@126.com 2020-04-22 09:09:34 +08:00
parent 718be42d78
commit 611aafdb4f
1 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ class Project < ApplicationRecord
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 :no_anomory_projects, -> {where("user_id != ?", 2)}
scope :no_anomory_projects, -> {where("projects.user_id != ?", 2)}
# 创建者
@ -105,7 +105,7 @@ class Project < ApplicationRecord
user_not_show_1 = projects.where("user_id != ?",user_id).pluck(:id).uniq
user_show_2 = projects.joins(:members).where("members.user_id = ?", user_id).pluck(:id).uniq
Project.no_anomory_projects.where("user_id != ?", 2).where.not(id: (user_not_show_1 - user_show_2).uniq)
Project.no_anomory_projects.where.not(id: (user_not_show_1 - user_show_2).uniq)
end
def members_count