diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-23 21:09:21 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-23 21:09:21 -0300 |
commit | d10d749a8029960284310634011368dcd96d1a4e (patch) | |
tree | dc350c267adb6c20c5a3acc795759c38625ee32d /activerecord/test | |
parent | fc6e86170f968e7ca7e62aa26308fd851170f1a1 (diff) | |
parent | 6b2ff4fa2082a51915d1c3e526b9194df44682de (diff) | |
download | rails-d10d749a8029960284310634011368dcd96d1a4e.tar.gz rails-d10d749a8029960284310634011368dcd96d1a4e.tar.bz2 rails-d10d749a8029960284310634011368dcd96d1a4e.zip |
Merge pull request #15290 from sgrif/sg-consolidate-zero-scale-decimal
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 |