Simple search implementation
This commit is contained in:
parent
b2c13bdd77
commit
5d2bd5ec3a
13 changed files with 127 additions and 4 deletions
|
@ -54,6 +54,10 @@ class Project < ActiveRecord::Base
|
|||
UsersProject.access_roles
|
||||
end
|
||||
|
||||
def self.search query
|
||||
where("name like :query or code like :query or path like :query", :query => "%#{query}%")
|
||||
end
|
||||
|
||||
def to_param
|
||||
code
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue