@@ -62,23 +62,23 @@ def filter_string_not_eql(scope, attribute, value)
6262 # anyway, we just don't support proper LIKE escaping in those versions.
6363 if ::ActiveRecord . version >= Gem ::Version . new ( "5.0.0" )
6464 def filter_string_match ( scope , attribute , value , is_not : false )
65- clause = sanitized_like_for ( scope , attribute , value ) do |v |
65+ clause = sanitized_like_for ( scope , attribute , value ) { |v |
6666 "%#{ v } %"
67- end
67+ }
6868 is_not ? scope . where . not ( clause ) : scope . where ( clause )
6969 end
7070
7171 def filter_string_prefix ( scope , attribute , value , is_not : false )
72- clause = sanitized_like_for ( scope , attribute , value ) do |v |
72+ clause = sanitized_like_for ( scope , attribute , value ) { |v |
7373 "#{ v } %"
74- end
74+ }
7575 is_not ? scope . where . not ( clause ) : scope . where ( clause )
7676 end
7777
7878 def filter_string_suffix ( scope , attribute , value , is_not : false )
79- clause = sanitized_like_for ( scope , attribute , value ) do |v |
79+ clause = sanitized_like_for ( scope , attribute , value ) { |v |
8080 "%#{ v } "
81- end
81+ }
8282 is_not ? scope . where . not ( clause ) : scope . where ( clause )
8383 end
8484 else
@@ -311,11 +311,11 @@ def column_for(scope, name)
311311 def sanitized_like_for ( scope , attribute , value , &block )
312312 escape_char = '\\'
313313 column = column_for ( scope , attribute )
314- map = value . map do |v |
314+ map = value . map { |v |
315315 v = v . downcase
316316 v = Sanitizer . sanitize_like ( v , escape_char )
317317 block . call v
318- end
318+ }
319319
320320 column . lower . matches_any ( map , escape_char , true )
321321 end
0 commit comments