GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Adds migration and schema dump support for macaddr, inet and cidr column types in the PostgreSQL adapter.
Converst inet and cidr types to NetAddr::CIDR objects, instead of using IPAddr, since NetAddr::CIDR handles subnets better.
Adds migration and schema dump support for INET, CIDR, and MACADDR
Converts inet and cidr columns to NetAddr::CIDR
I think that we should not add netaddr gem as Active Record dependency because we will only use it with PostgreSQL.
This is the one issue I thought the pull request would definitely have. I was unsure of how to make netaddr a PostgreSQL only dependency
I am going to update this so that it will try to use NetAddr if the user has included it, if not, it will fall back to IPAddr.
I'll fix it. We should just do a gem netaddr in the pg adapter code.
Removes NetAddr dependency
I have updated my implementation to remove NetAddr completely, after discovering how to extract the subnet mask from IPAddr
The tests all pass. I'm not familiar with the adapters, but am wondering if there is a way to push the Gemfile requirements onto the Postgres adapter gem (I'm assuming there's such a thing as Postgres adapter gem).
@tenderlove can you review?
@danmcclain looks great now.
@jeremyf the only way to push requirements to the PostgreSQL adapter is adding as requirement of the pg gem or other PostgreSQL gem.
this looks pretty good, 👍 on merge
Merge pull request #6192 from danmcclain/add_inet_and_cidr_types_to_p…
Add support for macaddr, inet, and cidr types to PostgreSQL adapter