This gem providers a custom Serializer for ActiveRecord to allow the storage and retrieval of an IPv4 or IPv6 Address in a String Field
Add this line to your application's Gemfile:
gem 'ip_address_serializer'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ip_address_serializer
Once the Gem has been added to your Gemfile, in any model that is required to hold an IP Address, add the following line to your model
serialize <field name symbol>, IPAddressSerializer
- Fork it ( https://github.com/msimkins/ip_address_serializer/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