diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-07-04 12:32:44 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-07-04 12:32:44 -0300 |
commit | 295f2bd1320b5dac6aa34e12baa670eb00e979cc (patch) | |
tree | 72be38bb743b115d60be98bdb9d3b2ab610194ee /activerecord/test | |
parent | a8e1538b6032be16c499a7049c2eaa1eeb2265ac (diff) | |
parent | efc436df2092bacc896dbf66ddc332aeafe42e72 (diff) | |
download | rails-295f2bd1320b5dac6aa34e12baa670eb00e979cc.tar.gz rails-295f2bd1320b5dac6aa34e12baa670eb00e979cc.tar.bz2 rails-295f2bd1320b5dac6aa34e12baa670eb00e979cc.zip |
Merge pull request #16037 from sgrif/sg-money-quoting
Remove unneccessary special case for money in quoting
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/money_test.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/money_test.rb b/activerecord/test/cases/adapters/postgresql/money_test.rb index cf2a4ab6ea..fa5e3cc281 100644 --- a/activerecord/test/cases/adapters/postgresql/money_test.rb +++ b/activerecord/test/cases/adapters/postgresql/money_test.rb @@ -70,4 +70,28 @@ class PostgresqlMoneyTest < ActiveRecord::TestCase money.reload assert_equal new_value, money.wealth end + + def test_update_all_with_money_string + money = PostgresqlMoney.create! + PostgresqlMoney.update_all(wealth: "987.65") + money.reload + + assert_equal 987.65, money.wealth + end + + def test_update_all_with_money_big_decimal + money = PostgresqlMoney.create! + PostgresqlMoney.update_all(wealth: '123.45'.to_d) + money.reload + + assert_equal 123.45, money.wealth + end + + def test_update_all_with_money_numeric + money = PostgresqlMoney.create! + PostgresqlMoney.update_all(wealth: 123.45) + money.reload + + assert_equal 123.45, money.wealth + end end |