Commit 806b76a168536ef05b20c5449f19164ea149583f

Authored by Dmitriy Zaporozhets
1 parent 4bf63212

rename scope to prevent name collision

app/controllers/public/projects_controller.rb
... ... @@ -6,7 +6,7 @@ class Public::ProjectsController < ApplicationController
6 6 layout 'public'
7 7  
8 8 def index
9   - @projects = Project.public
  9 + @projects = Project.public_only
10 10 @projects = @projects.includes(:namespace).order("namespaces.path, projects.name ASC").page(params[:page]).per(20)
11 11 end
12 12 end
... ...
app/models/project.rb
... ... @@ -91,7 +91,7 @@ class Project < ActiveRecord::Base
91 91 scope :sorted_by_activity, ->() { order("(SELECT max(events.created_at) FROM events WHERE events.project_id = projects.id) DESC") }
92 92 scope :personal, ->(user) { where(namespace_id: user.namespace_id) }
93 93 scope :joined, ->(user) { where("namespace_id != ?", user.namespace_id) }
94   - scope :public, -> { where(public: true) }
  94 + scope :public_only, -> { where(public: true) }
95 95  
96 96 class << self
97 97 def abandoned
... ...