summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-12 11:46:50 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-12 11:46:50 +0200
commit806b76a168536ef05b20c5449f19164ea149583f (patch)
treeebad364d524d3eca82463b9a60c8249a4b4af2c5
parent4bf63212d751db6450caac6fd07f5e2c8386e43e (diff)
downloadgitlab-ce-806b76a168536ef05b20c5449f19164ea149583f.tar.gz
rename scope to prevent name collision
-rw-r--r--app/controllers/public/projects_controller.rb2
-rw-r--r--app/models/project.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/public/projects_controller.rb b/app/controllers/public/projects_controller.rb
index 4108fe5f363..b929b23e68c 100644
--- a/app/controllers/public/projects_controller.rb
+++ b/app/controllers/public/projects_controller.rb
@@ -6,7 +6,7 @@ class Public::ProjectsController < ApplicationController
layout 'public'
def index
- @projects = Project.public
+ @projects = Project.public_only
@projects = @projects.includes(:namespace).order("namespaces.path, projects.name ASC").page(params[:page]).per(20)
end
end
diff --git a/app/models/project.rb b/app/models/project.rb
index c1e04899f65..acc1b8d2328 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -91,7 +91,7 @@ class Project < ActiveRecord::Base
scope :sorted_by_activity, ->() { order("(SELECT max(events.created_at) FROM events WHERE events.project_id = projects.id) DESC") }
scope :personal, ->(user) { where(namespace_id: user.namespace_id) }
scope :joined, ->(user) { where("namespace_id != ?", user.namespace_id) }
- scope :public, -> { where(public: true) }
+ scope :public_only, -> { where(public: true) }
class << self
def abandoned