aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2015-09-21 09:01:34 -0600
committerSean Griffin <sean@seantheprogrammer.com>2015-09-21 10:12:31 -0600
commite467deb6c66d9b45a0c596706284c140f8e1f1b3 (patch)
treeb48be9e4e2846b63b6dd9d11086584bd2bc3ddfe
parent9cc8c6f3730df3d94c81a55be9ee1b7b4ffd29f6 (diff)
downloadrails-e467deb6c66d9b45a0c596706284c140f8e1f1b3.tar.gz
rails-e467deb6c66d9b45a0c596706284c140f8e1f1b3.tar.bz2
rails-e467deb6c66d9b45a0c596706284c140f8e1f1b3.zip
`TypeMap` and `HashLookupTypeMap` shouldn't be in Active Model
These are used by the connection adapters to convert SQL type information into the appropriate type object, and makes no sense outside of the context of Active Record
-rw-r--r--activemodel/lib/active_model/type.rb2
-rw-r--r--activerecord/lib/active_record/type.rb7
-rw-r--r--activerecord/lib/active_record/type/hash_lookup_type_map.rb (renamed from activemodel/lib/active_model/type/hash_lookup_type_map.rb)2
-rw-r--r--activerecord/lib/active_record/type/type_map.rb (renamed from activemodel/lib/active_model/type/type_map.rb)2
4 files changed, 5 insertions, 8 deletions
diff --git a/activemodel/lib/active_model/type.rb b/activemodel/lib/active_model/type.rb
index 64346bcab2..e45354f417 100644
--- a/activemodel/lib/active_model/type.rb
+++ b/activemodel/lib/active_model/type.rb
@@ -16,8 +16,6 @@ require 'active_model/type/time'
require 'active_model/type/unsigned_integer'
require 'active_model/type/registry'
-require 'active_model/type/type_map'
-require 'active_model/type/hash_lookup_type_map'
module ActiveModel
module Type
diff --git a/activerecord/lib/active_record/type.rb b/activerecord/lib/active_record/type.rb
index 165043021b..5b089d66a0 100644
--- a/activerecord/lib/active_record/type.rb
+++ b/activerecord/lib/active_record/type.rb
@@ -16,14 +16,15 @@ require 'active_model/type/time'
require 'active_model/type/unsigned_integer'
require 'active_model/type/registry'
-require 'active_model/type/type_map'
-require 'active_model/type/hash_lookup_type_map'
require 'active_record/type/internal/abstract_json'
require 'active_record/type/internal/timezone'
require 'active_record/type/serialized'
require 'active_record/type/adapter_specific_registry'
+require 'active_record/type/type_map'
+require 'active_record/type/hash_lookup_type_map'
+
module ActiveRecord
module Type
@registry = AdapterSpecificRegistry.new
@@ -78,8 +79,6 @@ module ActiveRecord
Text = ActiveModel::Type::Text
UnsignedInteger = ActiveModel::Type::UnsignedInteger
Value = ActiveModel::Type::Value
- TypeMap = ActiveModel::Type::TypeMap
- HashLookupTypeMap = ActiveModel::Type::HashLookupTypeMap
register(:big_integer, Type::BigInteger, override: false)
register(:binary, Type::Binary, override: false)
diff --git a/activemodel/lib/active_model/type/hash_lookup_type_map.rb b/activerecord/lib/active_record/type/hash_lookup_type_map.rb
index 45d3515aad..3b01e3f8ca 100644
--- a/activemodel/lib/active_model/type/hash_lookup_type_map.rb
+++ b/activerecord/lib/active_record/type/hash_lookup_type_map.rb
@@ -1,4 +1,4 @@
-module ActiveModel
+module ActiveRecord
module Type
class HashLookupTypeMap < TypeMap # :nodoc:
def alias_type(type, alias_type)
diff --git a/activemodel/lib/active_model/type/type_map.rb b/activerecord/lib/active_record/type/type_map.rb
index 402b660a71..8ce36cc9af 100644
--- a/activemodel/lib/active_model/type/type_map.rb
+++ b/activerecord/lib/active_record/type/type_map.rb
@@ -1,6 +1,6 @@
require 'concurrent'
-module ActiveModel
+module ActiveRecord
module Type
class TypeMap # :nodoc:
def initialize