{"id":16948189,"url":"https://github.com/technicalpickles/has_ip_address","last_synced_at":"2025-09-26T15:31:02.532Z","repository":{"id":675960,"uuid":"319543","full_name":"technicalpickles/has_ip_address","owner":"technicalpickles","description":"An extension to ActiveRecord to store IP Addresses in the database as integers","archived":false,"fork":false,"pushed_at":"2009-09-28T21:24:28.000Z","size":97,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-12T00:20:30.097Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/technicalpickles.png","metadata":{"files":{"readme":"README.rdoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-09-28T05:04:38.000Z","updated_at":"2022-06-14T18:25:48.000Z","dependencies_parsed_at":"2022-08-16T10:40:21.793Z","dependency_job_id":null,"html_url":"https://github.com/technicalpickles/has_ip_address","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/technicalpickles/has_ip_address","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalpickles%2Fhas_ip_address","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalpickles%2Fhas_ip_address/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalpickles%2Fhas_ip_address/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalpickles%2Fhas_ip_address/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/technicalpickles","download_url":"https://codeload.github.com/technicalpickles/has_ip_address/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalpickles%2Fhas_ip_address/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277100567,"owners_count":25761016,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-26T02:00:09.010Z","response_time":78,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T21:49:55.904Z","updated_at":"2025-09-26T15:31:02.250Z","avatar_url":"https://github.com/technicalpickles.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"= has_ip_address\n\nAn extension to ActiveRecord to store IP Addresses in the database as integers, in part to IPAddr.\n\n    class Visit \u003c ActiveRecord::Base\n      has_ip_address\n    end\n\nHere's an example of using it:\n\n    \u003e\u003e visit = Visit.new\n    =\u003e #\u003cVisit id: nil, ip_address: nil, created_at: nil, updated_at: nil\u003e\n    \u003e\u003e visit.ip_address = \"127.0.0.1\"\n    =\u003e \"127.0.0.1\"\n    \u003e\u003e visit.ip_address\n    =\u003e #\u003cIPAddr: IPv4:127.0.0.1/255.255.255.255\u003e\n    \u003e\u003e visit.ip_address.to_i\n    =\u003e 2130706433\n    \u003e\u003e visit.ip_address.to_s\n    =\u003e \"127.0.0.1\"\n\nThis assumes you are using a column named :ip_address. To change this behavior, pass in a parameter with the column you care to use:\n\n\n    class Visit \u003c ActiveRecord::Base\n      has_ip_address :visit_ip\n    end\n\n== Known issues\n\n * Setting ip_address to an invalid IP address will fail with an ArgumentError from IPAddr.\n   * Ideally, it should let you pass any value in without error, but invalid IP addresses will add a validation error during validation\n   * In the mean time, you probably want to only this when the IP Address will definitely be correct, ie from a controller's `request.remote_ip`.\n\n== Note on Patches/Pull Requests\n \n* Fork the project.\n* Make your feature addition or bug fix.\n* Add tests for it. This is important so I don't break it in a\n  future version unintentionally.\n* Commit, do not mess with rakefile, version, or history.\n  (if you want to have your own version, that is fine but\n   bump version in a commit by itself I can ignore when I pull)\n* Send me a pull request. Bonus points for topic branches.\n\n== Copyright\n\nCopyright (c) 2009 Joshua Nichols. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnicalpickles%2Fhas_ip_address","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnicalpickles%2Fhas_ip_address","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnicalpickles%2Fhas_ip_address/lists"}