Use a LIKE test instead of equality
Fixes the ability to search for CVE (as well as other reference types) with a non-exact match [SeeRM #7989]
This commit is contained in:
@@ -666,11 +666,11 @@ class DBManager
|
||||
formatted_values = value_set.collect { |value|
|
||||
prefix = keyword.upcase
|
||||
|
||||
"#{prefix}-#{value}"
|
||||
"#{prefix}-%#{value}%"
|
||||
}
|
||||
|
||||
query = query.includes(:refs)
|
||||
union_conditions << Mdm::Module::Ref.arel_table[:name].eq_any(formatted_values)
|
||||
union_conditions << Mdm::Module::Ref.arel_table[:name].matches_any(formatted_values)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user