summaryrefslogtreecommitdiff
path: root/app/models/wiki.rb
diff options
context:
space:
mode:
authorIlya Baryshev <baryshev@gmail.com>2012-10-16 23:05:11 +0400
committerIlya Baryshev <baryshev@gmail.com>2012-10-16 23:05:11 +0400
commite6524a919ee4c92d82518c2520d5c0cabc32eb47 (patch)
tree483060d8211e80e73ac19ccab3ef86deb8f71fe9 /app/models/wiki.rb
parentdb3d90cbcb41c5b9a62998b185c90c10f9d03968 (diff)
downloadgitlab-ce-e6524a919ee4c92d82518c2520d5c0cabc32eb47.tar.gz
Wiki search
Very basic, using LIKE, and no search snippets.
Diffstat (limited to 'app/models/wiki.rb')
-rw-r--r--app/models/wiki.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/wiki.rb b/app/models/wiki.rb
index b1f41d636c7..895c2896462 100644
--- a/app/models/wiki.rb
+++ b/app/models/wiki.rb
@@ -15,6 +15,12 @@ class Wiki < ActiveRecord::Base
slug
end
+ class << self
+ def search(query)
+ where("title like :query OR content like :query", query: "%#{query}%")
+ end
+ end
+
protected
def self.regenerate_from wiki