rmm5t / strip_attributes

: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.
https://github.com/rmm5t/strip_attributes
MIT License
558 stars 51 forks source link

Avoid Encoding::CompatibilityError when handling binary column #29

Closed bcarreno closed 9 years ago

bcarreno commented 9 years ago

We started using strip_attributes in our project and found this runtime error when we try to strip a binary column. In PostgreSQL the type is called BYTEA.

Encoding::CompatibilityError: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)

Thank you for writing this gem!

rmm5t commented 9 years ago

Thanks!

rmm5t commented 9 years ago

v1.7.1 just released too. https://rubygems.org/gems/strip_attributes