lib/active_cleaner/utf8mb3_cleaner.rb in activecleaner-0.3.0 vs lib/active_cleaner/utf8mb3_cleaner.rb in activecleaner-0.3.1
- old
+ new
@@ -2,11 +2,14 @@
module ActiveCleaner
class Utf8mb3Cleaner < BaseCleaner
def clean_value(old_value, record=nil)
- unless old_value.nil?
+ case old_value
+ when String
old_value.each_char.select { |char| char.bytesize < 4 }.join('')
+ else
+ old_value
end
end
end
end