diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-07-20 19:46:16 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-07-20 19:46:16 +0900 |
commit | 2ec207520389f4a6acb393be45bc73cc3815ad76 (patch) | |
tree | 4604e75046b9223e74adde1041761bd991f332f8 /activerecord/test/cases/adapters | |
parent | 526d4b8dc816c17e354e2e0243af16d10147c3f0 (diff) | |
download | rails-2ec207520389f4a6acb393be45bc73cc3815ad76.tar.gz rails-2ec207520389f4a6acb393be45bc73cc3815ad76.tar.bz2 rails-2ec207520389f4a6acb393be45bc73cc3815ad76.zip |
Make `type_map` to private because it is only used in the connection adapter
`type_map` is an internal API and it is only used in the connection
adapter. And also, some type map initializer methods requires passed
`type_map`, but those instances already has `type_map` in itself.
So we don't need explicit passing `type_map` to the initializers.
Diffstat (limited to 'activerecord/test/cases/adapters')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/composite_test.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/type_lookup_test.rb | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/composite_test.rb b/activerecord/test/cases/adapters/postgresql/composite_test.rb index 1da2a9e2ac..6a34b78102 100644 --- a/activerecord/test/cases/adapters/postgresql/composite_test.rb +++ b/activerecord/test/cases/adapters/postgresql/composite_test.rb @@ -104,7 +104,7 @@ class PostgresqlCompositeWithCustomOIDTest < ActiveRecord::PostgreSQLTestCase def setup super - @connection.type_map.register_type "full_address", FullAddressType.new + @connection.send(:type_map).register_type "full_address", FullAddressType.new end def test_column diff --git a/activerecord/test/cases/adapters/postgresql/type_lookup_test.rb b/activerecord/test/cases/adapters/postgresql/type_lookup_test.rb index 784d77a8d1..f703b9bab6 100644 --- a/activerecord/test/cases/adapters/postgresql/type_lookup_test.rb +++ b/activerecord/test/cases/adapters/postgresql/type_lookup_test.rb @@ -6,16 +6,16 @@ class PostgresqlTypeLookupTest < ActiveRecord::PostgreSQLTestCase end test "array delimiters are looked up correctly" do - box_array = @connection.type_map.lookup(1020) - int_array = @connection.type_map.lookup(1007) + box_array = @connection.send(:type_map).lookup(1020) + int_array = @connection.send(:type_map).lookup(1007) assert_equal ";", box_array.delimiter assert_equal ",", int_array.delimiter end test "array types correctly respect registration of subtypes" do - int_array = @connection.type_map.lookup(1007, -1, "integer[]") - bigint_array = @connection.type_map.lookup(1016, -1, "bigint[]") + int_array = @connection.send(:type_map).lookup(1007, -1, "integer[]") + bigint_array = @connection.send(:type_map).lookup(1016, -1, "bigint[]") big_array = [123456789123456789] assert_raises(ActiveModel::RangeError) { int_array.serialize(big_array) } @@ -23,8 +23,8 @@ class PostgresqlTypeLookupTest < ActiveRecord::PostgreSQLTestCase end test "range types correctly respect registration of subtypes" do - int_range = @connection.type_map.lookup(3904, -1, "int4range") - bigint_range = @connection.type_map.lookup(3926, -1, "int8range") + int_range = @connection.send(:type_map).lookup(3904, -1, "int4range") + bigint_range = @connection.send(:type_map).lookup(3926, -1, "int8range") big_range = 0..123456789123456789 assert_raises(ActiveModel::RangeError) { int_range.serialize(big_range) } |