rename scope to prevent name collision

5-0-stable
Dmitriy Zaporozhets 2013-02-12 11:46:50 +02:00
parent 4bf63212d7
commit 806b76a168
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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