diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-09-21 09:01:34 -0600 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-09-21 10:12:31 -0600 |
commit | e467deb6c66d9b45a0c596706284c140f8e1f1b3 (patch) | |
tree | b48be9e4e2846b63b6dd9d11086584bd2bc3ddfe /activemodel/lib/active_model/type/hash_lookup_type_map.rb | |
parent | 9cc8c6f3730df3d94c81a55be9ee1b7b4ffd29f6 (diff) | |
download | rails-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
Diffstat (limited to 'activemodel/lib/active_model/type/hash_lookup_type_map.rb')
-rw-r--r-- | activemodel/lib/active_model/type/hash_lookup_type_map.rb | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/activemodel/lib/active_model/type/hash_lookup_type_map.rb b/activemodel/lib/active_model/type/hash_lookup_type_map.rb deleted file mode 100644 index 45d3515aad..0000000000 --- a/activemodel/lib/active_model/type/hash_lookup_type_map.rb +++ /dev/null @@ -1,23 +0,0 @@ -module ActiveModel - module Type - class HashLookupTypeMap < TypeMap # :nodoc: - def alias_type(type, alias_type) - register_type(type) { |_, *args| lookup(alias_type, *args) } - end - - def key?(key) - @mapping.key?(key) - end - - def keys - @mapping.keys - end - - private - - def perform_fetch(type, *args, &block) - @mapping.fetch(type, block).call(type, *args) - end - end - end -end |