summaryrefslogtreecommitdiff
path: root/app/models/environment.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r--app/models/environment.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb
index 3d3edcbbe66..fe438b142b2 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -54,7 +54,7 @@ class Environment < ApplicationRecord
# Search environments which have names like the given query.
# Do not set a large limit unless you've confirmed that it works on gitlab.com scale.
scope :for_name_like, -> (query, limit: 5) do
- where('name LIKE ?', "#{sanitize_sql_like(query)}%").limit(limit)
+ where(arel_table[:name].matches("#{sanitize_sql_like query}%")).limit(limit)
end
scope :for_project, -> (project) { where(project_id: project) }