strip_attributes

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.

MIT License

Downloads
12.8M
Stars
558
Committers
24
strip_attributes - Latest Release

Published by rmm5t over 2 years ago

  • Added a matcher for replace_newlines (#62)
  • Added Ruby 3.1 support
strip_attributes -

Published by rmm5t almost 3 years ago

  • Switches to GitHub CI Workflows
  • Adds support for Rails 7.0 (#58 and #59).
strip_attributes -

Published by rmm5t over 4 years ago

  • Prevent stripping frozen values (#53)
strip_attributes -

Published by rmm5t over 4 years ago

  • Fix strip behavior for frozen values (#53)

NOTE: This fix is backwards incompatible, but a future version will avoid stripping frozen values altogether.

strip_attributes -

Published by rmm5t over 4 years ago

  • Clean up and remove (now) redundant #respond_to? calls (#49)
  • Legacy and deprecation cleanup (#50)
  • Update matcher to take list of arguments; alias it as #strip_attributes (#52)
strip_attributes -

Published by rmm5t over 4 years ago

  • Fix regression in 1.9.1: Arrays & Hashes now become nil #48
strip_attributes -

Published by rmm5t over 4 years ago

  • Add official Ruby 2.7 support #45
  • Zero-width space doesn't result in nil after stripping #46
  • Fix zero width space strip to nil #47
strip_attributes -

Published by rmm5t over 5 years ago

  • Adds :if and :unless options (#37)
strip_attributes -

Published by rmm5t almost 6 years ago

  • Add Rails 6 compatibility (#36)
strip_attributes -

Published by rmm5t over 8 years ago

  • Added multibyte whitespace support to :collapse_spaces option (#32)
strip_attributes -

Published by rmm5t about 9 years ago

  • Avoid Encoding::CompatibilityError when handling binary column #29
strip_attributes -

Published by rmm5t over 9 years ago

  • Added option to remove all newlines #27 :replace_newlines
strip_attributes -

Published by rmm5t over 9 years ago

  • Add regular expression support #14
  • Handle Unicode whitespace and invisible characters #15
strip_attributes -

Published by rmm5t over 9 years ago

  • Updated matcher signatures to account for RSpec 3
strip_attributes -

Published by rmm5t over 9 years ago

  • Refactored to expose StripeAttributes.strip
  • Added fallback to String#strip for non-multibyte support