diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-04-02 16:43:42 -0700 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-04-02 16:43:42 -0700 |
commit | 3d02472ecd17599b614dabc2df2cb7c3ea13026f (patch) | |
tree | 2f97b4ce85e28323dc23b6da9d154fbcd77a89d9 /app/models/runner.rb | |
parent | 66bbfc7f117135492d60c9e331ba347e5f2a2155 (diff) | |
download | gitlab-ci-search-runners.tar.gz |
Search runners by token or description on admin/runners pagesearch-runners
Diffstat (limited to 'app/models/runner.rb')
-rw-r--r-- | app/models/runner.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/runner.rb b/app/models/runner.rb index ed70097..bfd5a54 100644 --- a/app/models/runner.rb +++ b/app/models/runner.rb @@ -28,6 +28,11 @@ class Runner < ActiveRecord::Base acts_as_taggable + def self.search(query) + where('LOWER(runners.token) LIKE :query OR LOWER(runners.description) like :query', + query: "%#{query.try(:downcase)}%") + end + def set_default_values self.token = SecureRandom.hex(15) if self.token.blank? end |