app/components/kadmin/finder.rb in kadmin-0.6.17 vs app/components/kadmin/finder.rb in kadmin-0.6.18
- old
+ new
@@ -29,10 +29,10 @@
# @param [String, Array<String>] value the value or values to look for (OR'd)
def filter(name:, column:, value:)
if column.present?
@filters[name] = Kadmin::Finder::Filter.new(column, value)
if value.present?
- search_value = ActiveRecord::Base.sanitize("%#{value}%".squeeze('%'))
+ search_value = ActiveRecord::Base.connection.quote("%#{value}%".squeeze('%'))
filters = Array.wrap(column).map do |column_name|
%(`#{@scope.table_name}`.`#{column_name}` LIKE #{search_value})
end
@scope = @scope.where(filters.join(' OR '))
@filtering = true