diff options
-rw-r--r-- | app/models/ci/runner.rb | 2 | ||||
-rw-r--r-- | app/models/group.rb | 2 | ||||
-rw-r--r-- | app/models/note.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 2 | ||||
-rw-r--r-- | app/models/snippet.rb | 2 | ||||
-rw-r--r-- | app/models/user.rb | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index ce2750b071c..90349a07594 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -59,7 +59,7 @@ module Ci # # Returns an ActiveRecord::Relation. def self.search(query) - t = Ci::Runner.arel_table + t = arel_table pattern = "%#{query}%" where(t[:token].matches(pattern).or(t[:description].matches(pattern))) diff --git a/app/models/group.rb b/app/models/group.rb index bfeddf8b4d2..afbc2922013 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -41,7 +41,7 @@ class Group < Namespace # # Returns an ActiveRecord::Relation. def search(query) - table = Group.arel_table + table = Namespace.arel_table pattern = "%#{query}%" where(table[:name].matches(pattern).or(table[:path].matches(pattern))) diff --git a/app/models/note.rb b/app/models/note.rb index 76e86fdbcaa..8b0610ff77e 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -113,7 +113,7 @@ class Note < ActiveRecord::Base # # Returns an ActiveRecord::Relation. def search(query) - table = Note.arel_table + table = arel_table pattern = "%#{query}%" where(table[:note].matches(pattern)) diff --git a/app/models/project.rb b/app/models/project.rb index cb236bf41cd..ce103398a9a 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -274,7 +274,7 @@ class Project < ActiveRecord::Base # # query - The search query as a String. def search(query) - ptable = Project.arel_table + ptable = arel_table ntable = Namespace.arel_table pattern = "%#{query}%" diff --git a/app/models/snippet.rb b/app/models/snippet.rb index 35d05af38bf..b9e835a4486 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -121,7 +121,7 @@ class Snippet < ActiveRecord::Base # # Returns an ActiveRecord::Relation. def search(query) - t = Snippet.arel_table + t = arel_table pattern = "%#{query}%" where(t[:title].matches(pattern).or(t[:file_name].matches(pattern))) diff --git a/app/models/user.rb b/app/models/user.rb index 725f748faf0..101303e1f1f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -294,7 +294,7 @@ class User < ActiveRecord::Base # # Returns an ActiveRecord::Relation. def search(query) - table = User.arel_table + table = arel_table pattern = "%#{query}%" where( |