fix unauth for public

This commit is contained in:
Dmitriy Zaporozhets 2013-01-12 21:54:52 +02:00
parent 4c6224aad1
commit 122acb2254
5 changed files with 16 additions and 13 deletions

View file

@ -81,6 +81,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)
class << self
def active