Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Edited via GitHub

  • Loading branch information...
commit 6b8e179ea66fd62c1c913e4bdaec844d75eba3ab 1 parent 27e5ebc
@holli holli authored
Showing with 12 additions and 1 deletion.
  1. +12 −1
@@ -33,14 +33,25 @@ end
Gem has been tested with ruby 1.8.7, 1.9.2 and Rails 3.x. Although it should also work with previous versions of rails.
# Support
Submit suggestions or feature requests as a GitHub Issue or Pull Request. Remember to update tests. Tests are quite extensive.
+# Other approaches
+This gem works by addin before_validation hook and setting attributes with self[attribute]=stripped_value. See:
+Other approaches could include calling attribute= from before_validation. This would end up calling possible custom setters twice. Might not be desired effect (e.g. if setter does some logging).
+Method chaining attribute= can be also used. But then stripping would be omitted if there is some code that calls model[attribute]= directly. This could happen easily when using hashes in some places.
## Similar gems
There are many similar gems. Most of those don't have :squish or :nullify options. Those gems
-might have some extra methods whereas this gem is kept as simple as possible.
+might have some extra methods whereas this gem is kept as simple as possible. These gems have a bit
+different approaches. See discussion in previous chapter.
Please sign in to comment.
Something went wrong with that request. Please try again.