diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-05-17 12:24:13 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-05-19 08:07:21 -0700 |
commit | 0b682e4b05c8f58c77c655650af6638c483ac903 (patch) | |
tree | e22d197ed7d828dad7f249d8878a8fb8cff1ebd2 /activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | |
parent | a0eec57ef0fbbbb2910a46ca65bd5b565ca0534c (diff) | |
download | rails-0b682e4b05c8f58c77c655650af6638c483ac903.tar.gz rails-0b682e4b05c8f58c77c655650af6638c483ac903.tar.bz2 rails-0b682e4b05c8f58c77c655650af6638c483ac903.zip |
Delegate `Column#type` to the injected type object
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.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 183d0c4ec6..59e157744f 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -539,10 +539,6 @@ module ActiveRecord private - def type_map - @type_map - end - def get_oid_type(oid, fmod, column_name) if !type_map.key?(oid) initialize_type_map(type_map, [oid]) @@ -554,11 +550,6 @@ module ActiveRecord } end - def reload_type_map - type_map.clear - initialize_type_map(type_map) - end - def initialize_type_map(type_map, oids = nil) if supports_ranges? query = <<-SQL |