:hocho: An ActiveModel extension that automatically strips all attributes of leading and trailing whitespace before validation. If the attribute is blank, it strips the value to nil.
We had a bug with frozen Strings. It's not clear that the stripping was also mutating, and it was failing silently on the frozen String. I figure there are basically 2 ways to go here: raise on the frozen String or dup the String.
As I see no reason to expect that this method mutates the String (ie it's not a bang method like the gsub! that actually mutates), the dup method seems appropriate.
We had a bug with frozen Strings. It's not clear that the stripping was also mutating, and it was failing silently on the frozen String. I figure there are basically 2 ways to go here: raise on the frozen String or dup the String.
As I see no reason to expect that this method mutates the String (ie it's not a bang method like the gsub! that actually mutates), the dup method seems appropriate.