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:
James Lee
2013-05-29 16:12:31 -05:00
parent e7a1f06fbc
commit 12f0448bb4
+2 -2
View File
@@ -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