diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-27 21:15:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-27 21:15:03 +0300 |
commit | 3538972a0a6417e01f8e44c716d061520841cbce (patch) | |
tree | 32f13d48f0c18858dade1f260e49208ad26f4c40 /app/models/packages | |
parent | 1403e9bc459bcf37c9fdfb61aadd268d11b0abfd (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/packages')
-rw-r--r-- | app/models/packages/package.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/packages/package.rb b/app/models/packages/package.rb index b4c09d99bb0..b7c784d9351 100644 --- a/app/models/packages/package.rb +++ b/app/models/packages/package.rb @@ -114,6 +114,10 @@ class Packages::Package < ApplicationRecord ) end + scope :with_case_insensitive_version, ->(version) do + where('LOWER(version) = ?', version.downcase) + end + scope :search_by_name, ->(query) { fuzzy_search(query, [:name], use_minimum_char_limit: false) } scope :with_version, ->(version) { where(version: version) } scope :without_version_like, -> (version) { where.not(arel_table[:version].matches(version)) } |