diff options
author | Toon Claes <toon@gitlab.com> | 2017-05-31 00:24:17 +0300 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2017-05-31 00:24:17 +0300 |
commit | 1e5506d01619780da68fc51ada58188a9070255b (patch) | |
tree | b26383b07e7e4c279299e90d99d1b04804c49130 /app | |
parent | db679788e46d55984a4af71034c6db11aed919e4 (diff) |
Remove some deprecated methods
To avoid the use of slow queries, remove some deprecated methods and encourage
the use of ProjectFinder to find projects.
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/dashboard_controller.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 4 | ||||
-rw-r--r-- | app/models/user.rb | 6 |
3 files changed, 1 insertions, 11 deletions
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 6195121b931..f9c31920302 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -24,7 +24,7 @@ class DashboardController < Dashboard::ApplicationController def load_events projects = if params[:filter] == "starred" - current_user.viewable_starred_projects + ProjectsFinder.new(current_user: current_user, params: { starred: true }).execute else current_user.authorized_projects end diff --git a/app/models/project.rb b/app/models/project.rb index 963fd594d46..457399cb60e 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -351,10 +351,6 @@ class Project < ActiveRecord::Base where("projects.id IN (#{union.to_sql})") end - def search_by_visibility(level) # DEPRECATED: remove with API V3 - where(visibility_level: Gitlab::VisibilityLevel.string_options[level]) - end - def search_by_title(query) pattern = "%#{query}%" table = Project.arel_table diff --git a/app/models/user.rb b/app/models/user.rb index 20894ce269a..9aad327b592 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -557,12 +557,6 @@ class User < ActiveRecord::Base authorized_projects(Gitlab::Access::REPORTER).where(id: projects) end - def viewable_starred_projects # DEPRECATED: Use ProjectFinder instead. Remove together with API V3 - starred_projects.where("projects.visibility_level IN (?) OR projects.id IN (?)", - [Project::PUBLIC, Project::INTERNAL], - authorized_projects.select(:project_id)) - end - def owned_projects @owned_projects ||= Project.where('namespace_id IN (?) OR namespace_id = ?', |