This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Tue Nov 11 15:47:12 -0800 2008 | |
| |
README | ||
| |
Rakefile | Tue Nov 11 15:47:12 -0800 2008 | |
| |
init.rb | Tue Nov 11 15:47:12 -0800 2008 | |
| |
lib/ | ||
| |
test/ |
README
This code helps you store IP addresses as ints in the database. Create a column on your ActiveRecord model to store IP addresses. In my app, that was a migration like this: add_column :my_models, :ipaddress, :integer, :limit => 8 (Make sure the column is big enough to store an IP) Then in your model, use has_ip_column: has_ip_column :ipaddress On instances of MyModel, you can now set ipaddress as a dotted decimal string: MyModel.new(:ipaddress => "201.102.201.102") When you save the model, it's stored as an integer in the database.








