rails/rails — pull request #8010 by subwindow (2012-10-22 17:57:18+00:00)
Title: Fix default output for postgres network address types

On master, when a default value is given for a postgres network address type (inet, cidr, macaddr), the output of the schema.rb dump is incorrect:

```ruby
t.inet "dns_address", default: #, null: false
```

This patch fixes the issue, outputting them as strings. It also fixes the tests so that the network address tests actually run- previously the regexes didn't match and thus never asserted that the columns were in the schema dump at all.

A couple things that are suboptimal about this patch:
* The ipaddr stdlib is required now for all adapters, not just postgres. I don't think this is a serious issue in real-world deployments (actionpack requires it, for instance). The alternative would be to develop a postgres-specific implementation of ColumnDumper, and that seems difficult.
* We're now duplicating the logic for pulling a subnet mask out of an IPAddr in two places. We should probably monkey-patch IPAddr in activesupport. That's another patch, however.