attribute_normalizer
attribute_normalizer copied to clipboard
Adds the ability to normalize attributes cleanly with code blocks and predefined normalizers
Hello, We are planning to use attribute_normalizer for our project running in Ruby 3.1.2 and Rails 6 ( we also have plan to shift to Rails 7 later in this...
You merge in 2020 Pull Request #75. It would be really great to see a new release with that change. Thanks and best regards
For example, if you are normalizing an array attribute and you do any of the following: ``` book.categories.push('fiction') book.categories
Potential feature idea - grouping of normalizers within the initializer for re-use purposes. Something similar to: ``` AttributeNormalizer.configure do |config| config.groupings[:group] = [:strip, :blank, :custom, :custom] end class Model attribute_normalizer...
I would like to create a normalizer with auto-truncation feature, so I need to know the current limit of a table field. To determine the length of the field I...
Just an FYI I started to use this gem latest version yesterday and was pleased with it's benefits. However I am heavily using mutation testing (mbj/mutant) of whom @dkubb is...
Great gem, but I have some questions that aren't super obvious from the ReadMe: If I call normalize_attribute a second time on the same attribute, does it remove the first...
I found that I needed this in order to use Array types with attribute_normalizer.
Currently if somebody uses something like `normalize_attribute :name` it makes impossible to have `normalize_name` method in the corresponding model, I suggest the defined method is at least given some kind...
A quick little method I wrote for myself to be able to manually trigger a test. Usage ``` ruby AttributeNormalizer.normalize(:phone, "555-123-5123 ") > 5551235123 ``` Implementation ``` ruby module AttributeNormalizer...