rails/rails — pull request #13793 by senny (2014-01-22 13:35:11+00:00)
Title: Dynamically define PostgreSQL Range OIDs

This patch improves the current support for PostgreSQL Ranges by:
* Adding support for custom range types
* Removing branches in the current range implementation
* Deprecating half-baked support for PG range values with excluding beginnings.

### dynamically define PostgreSQL OID range types.
This gets AR working with custom defined range types. It also
removes the need for subtype specific branches in `OID::Range`.

This expands the interface of all `OID` types with the `infinity` method.
It's responsible to provide a value for positive and negative infinity.

### deprecate support for pg ranges with excluding beginnings.
The Ruby Range object does not support excluding beginnings.
We currently support excluding beginnings for some subtypes using
manually by incrementing them (now using the `#succ` method).
This is approach is flawed as it's not equal to an excluding beginning.

This commit deprecates the current support for excluding beginnings.
It also raises an `ArgumentError` for subtypes that do not implement the `succ`
method.

This is a temporary solution to get rid of the broken state. We might still
add complete support for excluding beginnings afterwards. (Probably with a
new `PGRange` object, which acts like a `Range` but has excluding beginnings.