Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #8041: make_decimals_decimal.diff

File make_decimals_decimal.diff, 2.1 kB (added by wycats, 1 year ago)
  • activerecord/test/base_test.rb

    old new  
    11011101    # As with migration_test.rb, we should make world_population >= 2**62 
    11021102    # to cover 64-bit platforms and test it is a Bignum, but the main thing 
    11031103    # is that it's an Integer. 
    1104     assert_kind_of Integer, m1.world_population 
     1104    assert_kind_of BigDecimal, m1.world_population 
    11051105    assert_equal 6000000000, m1.world_population 
    11061106 
    1107     assert_kind_of Fixnum, m1.my_house_population 
     1107    assert_kind_of BigDecimal, m1.my_house_population 
    11081108    assert_equal 3, m1.my_house_population 
    11091109 
    11101110    assert_kind_of BigDecimal, m1.bank_balance 
  • activerecord/test/migration_test.rb

    old new  
    547547 
    548548      # TODO: set world_population >= 2**62 to cover 64-bit platforms and test 
    549549      # is_a?(Bignum) 
    550       assert_kind_of Integer, b.world_population 
     550      assert_kind_of BigDecimal, b.world_population 
    551551      assert_equal 6000000000, b.world_population 
    552       assert_kind_of Fixnum, b.my_house_population 
     552      assert_kind_of BigDecimal, b.my_house_population 
    553553      assert_equal 3, b.my_house_population 
    554554      assert_kind_of BigDecimal, b.bank_balance 
    555555      assert_equal BigDecimal("1586.43"), b.bank_balance 
  • activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb

    old new  
    184184            when /float|double/i 
    185185              :float 
    186186            when /decimal|numeric|number/i 
    187               extract_scale(field_type) == 0 ? :integer : :decimal 
     187              :decimal 
    188188            when /datetime/i 
    189189              :datetime 
    190190            when /timestamp/i