lib/koine/attributes/adapter/string.rb in koine-attributes-1.2.3 vs lib/koine/attributes/adapter/string.rb in koine-attributes-1.2.4
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module Koine
module Attributes
module Adapter
class String < Base
def empty_to_nil
@@ -18,9 +20,10 @@
def coerce_not_nil(value)
secure do
value = String(value)
value = value.strip if @trim_empty_spaces
return nil if value.empty? && @empty_to_nil
+
value
end
end
end
end