All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
2.0.0 - 2021-08-18
- Rails lifecycle hooks:
before_sanitization
andafter_sanitization
. - Support for custom model sanitizers using
sanitizes_with
. - Support for custom field sanitizers through classes that implement a
sanitizes_each
method.
- Sanitization is now specified on a per-field basis and follow the same patterns as ActiveRecord::Validations.
- Renamed
collapse
tosquish
to better match convention.
- Initializer/Configuration. Sanitization is not configured at a global level.
- Support for
only
andexcept
keywords. - Removed
sanitization
method to better follow convention.
1.1.1 - 2021-05-06
sanitization
method tosanitizes
as the new preferred way.sanitization
still works and is an alias ofsanitizes
.
1.1.0 - 2021-05-06
- Support for configuration block.
- BREAKING CHANGE: By default, Sanitization now does nothing. A configuration block should be used to set your desired defaults. Add
Sanitization.simple_defaults!
toconfig/initializers/sanitization.rb
for version 1.0.x defaults.
1.0.0 - 2021-05-03
- Initial Release