diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-05-23 15:31:30 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-05-23 16:35:36 -0700 |
commit | 6b2ff4fa2082a51915d1c3e526b9194df44682de (patch) | |
tree | a60dfc13bb8e0a1be29f258e4c2e8457b6d4e32e /activerecord/test | |
parent | 21f99b4be00e5cfa298a15732d054aaf2df00213 (diff) | |
download | rails-6b2ff4fa2082a51915d1c3e526b9194df44682de.tar.gz rails-6b2ff4fa2082a51915d1c3e526b9194df44682de.tar.bz2 rails-6b2ff4fa2082a51915d1c3e526b9194df44682de.zip |
Remove special case in schema dumper for decimal without scale
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/connection_adapters/type_lookup_test.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/activerecord/test/cases/connection_adapters/type_lookup_test.rb b/activerecord/test/cases/connection_adapters/type_lookup_test.rb index 18df30faf5..3958c3bfff 100644 --- a/activerecord/test/cases/connection_adapters/type_lookup_test.rb +++ b/activerecord/test/cases/connection_adapters/type_lookup_test.rb @@ -77,12 +77,16 @@ module ActiveRecord assert_lookup_type :integer, 'tinyint' assert_lookup_type :integer, 'smallint' assert_lookup_type :integer, 'bigint' - assert_lookup_type :integer, 'decimal(2)' - assert_lookup_type :integer, 'decimal(2,0)' - assert_lookup_type :integer, 'numeric(2)' - assert_lookup_type :integer, 'numeric(2,0)' - assert_lookup_type :integer, 'number(2)' - assert_lookup_type :integer, 'number(2,0)' + end + + def test_decimal_without_scale + types = %w{decimal(2) decimal(2,0) numeric(2) numeric(2,0) number(2) number(2,0)} + types.each do |type| + cast_type = @connection.type_map.lookup(type) + + assert_equal :decimal, cast_type.type + assert_equal 2, cast_type.type_cast(2.1) + end end private |