- Treat blank strings as nil when
strip
andempty_is_nil
options are set (#148, @saverio-kantox) - Don't use full key in nested error messages (#149, @eugeneius)
- Don't remove unknown characters in string filter (#150, @eugeneius)
- Retain
_id
suffix in error keys (#129, @khalilovcmd) - Add a symbol filter:
symbol :color, in: %i(red blue green)
(#119, @estraph) - Add
empty_is_nil
option to string filter (#135, @skylerwshaw)
- Add
min_length
andmax_length
options to array filter (#128, @jwoertink) - Add
empty_is_nil
option to date filter (#122, @jamesacarr) - Respect
Mutations.cache_constants
in array filters (#125, @eugeneius)
- Add
:error_key
filter option to allow error messages to be customised. (#115, @mwhatters) - Accept hash inputs that respond to
to_hash
. (#126, @antoniobg)
- Ruby 2.4 support added
- Add Time filter:
time :start_time
- Remove unprintable characters from
string
by default. - Add bigdecimal and float as non-strict string input options
- Additonal filters that are used in arrays can now have block arguments
- Add
empty_is_nil
option to integer filter.
- Bug fix: discards_empty broke on non-strings. Fix that.
- Bug fix: If your optional filter discards_empty and strips, then discard whitespace.
- Ruby 2.1 support added.
- Ruby 1.8.7 support removed.
- Rubinius support updated.
- Gemfile.lock removed (Rails 4 support, etc)
- API change: Add ability to implement a 'validate' method
discard_invalid
option added- AdditionFilters: Gain ability to pass blocks to filters.
- Add pluggable filters.
- Add ruby 1.8.7 support [#19]
- Add a date filter:
date :start_date
(/via @eliank and @geronimo) Mutations.cache_constants = false
if you want to work in Rails dev mode which redefines constants. [#23]
- Added a duck filter:
duck :lengthy, methods: :length
to ensure all values respond_to? :length [#14] - Added a file filter:
file :data
to ensure the data is a File-like object [#15] - Allow raw_inputs to be used as method inside of execute to access the original data passed in. (@tomtaylor)
- integer filter now allows the
in
option. Eg:integer :http_code, in: (200, 404, 401)
(/via @tomtaylor) - Added a changelog. [#10]
- Float filter (@aq1018)
- Clean up public API + code (@blambeau)
- Model filters should lazily resolve their classes so that mocks can be used (@edwinv)
- Filtered inputs should be included in the Outcome
- Fix typos (@frodsan)
- Initial versions