Make admin project list more useful

This commit is contained in:
Dmitriy Zaporozhets 2012-11-23 07:24:09 +03:00
parent 552b3105fb
commit f17ddeb394
6 changed files with 30 additions and 8 deletions

View file

@ -10,6 +10,8 @@ class Namespace < ActiveRecord::Base
delegate :name, to: :owner, allow_nil: true, prefix: true
scope :root, where('type IS NULL')
def self.search query
where("name LIKE :query OR code LIKE :query", query: "%#{query}%")
end

View file

@ -80,7 +80,7 @@ class Project < ActiveRecord::Base
end
def search query
where("name LIKE :query OR code LIKE :query OR path LIKE :query", query: "%#{query}%")
where("projects.name LIKE :query OR projects.code LIKE :query OR projects.path LIKE :query", query: "%#{query}%")
end
def create_by_user(params, user)