aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-02-10 15:58:39 -0700
committerSean Griffin <sean@thoughtbot.com>2015-02-11 08:49:31 -0700
commitaafee233fb3b4211ee0bfb1fca776c159bd1067e (patch)
treee56375fa85fcec65d68e9192c8d6f713f9d5a7c4 /activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb
parent9a656a7776b2be0a13f8f20eedbca7fb5d184b34 (diff)
downloadrails-aafee233fb3b4211ee0bfb1fca776c159bd1067e.tar.gz
rails-aafee233fb3b4211ee0bfb1fca776c159bd1067e.tar.bz2
rails-aafee233fb3b4211ee0bfb1fca776c159bd1067e.zip
Remove most PG specific type subclasses
The latest version of the PG gem can actually convert the primitives for us in C code, which gives a pretty substantial speed up. A few cases were only there to add the `infinity` method, which I just put on the range type (which is the only place it was used). Floats also needed to parse `Infinity` and `NaN`, but it felt reasonable enough to put that on the generic form.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb b/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb
index 9b3de41fab..42ab6ec4bd 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb
@@ -8,8 +8,9 @@ module ActiveRecord
# - Type is an OID::Type object.
# This class has side effects on the +store+ passed during initialization.
class TypeMapInitializer # :nodoc:
- def initialize(store)
+ def initialize(store, run_complex_types = true)
@store = store
+ @run_complex_types = run_complex_types
end
def run(records)