aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/type/type_map.rb
Commit message (Collapse)AuthorAgeFilesLines
* Allow additional arguments to be used during type map lookupsSean Griffin2014-05-221-4/+4
| | | | | | | | Determining things like precision and scale in postgresql will require the given blocks to take additional arguments besides the OID. - Adds the ability to handle additional arguments to `TypeMap` - Passes the column type to blocks when looking up PG types
* Delegate `Column#type` to the injected type objectSean Griffin2014-05-191-0/+50
The decision to wrap type registrations in a proc was made for two reasons. 1. Some cases need to make an additional decision based on the type (e.g. a `Decimal` with a 0 scale) 2. Aliased types are automatically updated if they type they point to is updated later. If a user or another adapter decides to change the object used for `decimal` columns, `numeric`, and `number` will automatically point to the new type, without having to track what types are aliased explicitly. Everything else here should be pretty straightforward. PostgreSQL ranges had to change slightly, since the `simplified_type` method is gone.