mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-16 16:16:43 +10:00
Removed arel_table receiver from search methods
We can just use "arel_table" in these cases instead of "SomeClass.arel_table".
This commit is contained in:
committed by
Robert Speicher
parent
0ab9571ad7
commit
d7d5937531
@@ -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)))
|
||||
|
||||
+1
-1
@@ -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)))
|
||||
|
||||
+1
-1
@@ -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))
|
||||
|
||||
@@ -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}%"
|
||||
|
||||
|
||||
@@ -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)))
|
||||
|
||||
+1
-1
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user