Skip to content
Snippets Groups Projects

[WIP] Moves the stage and ref from the table in a ci commit build to a plain one line text

Closed Tiago Botelho requested to merge tiagonbotelho/gitlab-ce:ci-commit into master
2 files
+ 35
6
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 11
1
@@ -52,8 +52,18 @@ def find_by_path_or_name(path)
@@ -52,8 +52,18 @@ def find_by_path_or_name(path)
find_by("lower(path) = :path OR lower(name) = :path", path: path.downcase)
find_by("lower(path) = :path OR lower(name) = :path", path: path.downcase)
end
end
 
# Searches for namespaces matching the given query.
 
#
 
# This method uses ILIKE on PostgreSQL and LIKE on MySQL.
 
#
 
# query - The search query as a String
 
#
 
# Returns an ActiveRecord::Relation
def search(query)
def search(query)
where("name LIKE :query OR path LIKE :query", query: "%#{query}%")
t = arel_table
 
pattern = "%#{query}%"
 
 
where(t[:name].matches(pattern).or(t[:path].matches(pattern)))
end
end
def clean_path(path)
def clean_path(path)
Loading