Commit 26338148 authored by Valery Sizov's avatar Valery Sizov

spec fix

parent 3668dba8
......@@ -12,7 +12,7 @@ module Elastic
end
def self.repositories_count
Project.where(wiki_enabled: true).count
Project.with_wiki_enabled.count
end
def client_for_indexing
......@@ -20,7 +20,7 @@ module Elastic
end
def self.import
Project.where(wiki_enabled: true).find_each do |project|
Project.with_wiki_enabled.find_each do |project|
unless project.wiki.empty?
project.wiki.index_blobs
end
......
......@@ -207,6 +207,7 @@ class Project < ActiveRecord::Base
scope :with_builds_enabled, -> { joins('LEFT JOIN project_features ON projects.id = project_features.project_id').where('project_features.builds_access_level IS NULL or project_features.builds_access_level > 0') }
scope :with_issues_enabled, -> { joins('LEFT JOIN project_features ON projects.id = project_features.project_id').where('project_features.issues_access_level IS NULL or project_features.issues_access_level > 0') }
scope :with_wiki_enabled, -> { joins('LEFT JOIN project_features ON projects.id = project_features.project_id').where('project_features.wiki_access_level IS NULL or project_features.wiki_access_level > 0') }
scope :active, -> { joins(:issues, :notes, :merge_requests).order('issues.created_at, notes.created_at, merge_requests.created_at DESC') }
scope :abandoned, -> { where('projects.last_activity_at < ?', 6.months.ago) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment