AttributeNormalizer::Extras
Extra normalizers for the attribute_normalizer gem
Installation
Add this line to your application's Gemfile:
gem 'attribute_normalizer-extras'
And then execute:
$ bundle
Or install it yourself as:
$ gem install attribute_normalizer-extras
Usage
class Foo < ActiveRecord::Base
normalize_attribute :postal_code, with: :postal_code
normalize_attribute :email, with: :gsub, pattern: /(googlemail.com)/, replacement: "gmail.com"
normalize_attribute :country_abbreviation, with: :spaceless
end
Contributing
- Fork it ( https://github.com/[my-github-username]/attribute_normalizer-extras/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request