Skip to content
Snippets Groups Projects

Admin runner filtering by version

Merged Markus Ferrell requested to merge markus.ferrell/gitlab:admin_runner_sorting into master
All threads resolved!
3 files
+ 5
3
Compare changes
  • Side-by-side
  • Inline
Files
3
  • 354240f4
    Add SQL sanitization to query · 354240f4
    Joe Snyder authored
    Per suggestion, add the sql_sanitization_like to the value that
    will be matched.
    
    Fix rubcop issues created during rebase
@@ -62,7 +62,9 @@ class RunnerManager < Ci::ApplicationRecord
scope :order_id_desc, -> { order(id: :desc) }
scope :with_version_prefix, ->(value) { where(arel_table[:version].matches("#{value}%", case_sensitive: true)) }
scope :with_version_prefix, ->(value) do
where(arel_table[:version].matches("#{sanitize_sql_like(value)}%", nil, true))
end
scope :with_upgrade_status, ->(upgrade_status) do
joins(:runner_version).where(runner_version: { status: upgrade_status })
Loading