Permalink
Browse files

Fix ORA-00932 error when trying to insert 0 to DATE type columns.

  • Loading branch information...
1 parent 4a4927f commit 5bc23e4fb503e038c8e24a3a58d4eb1c323e94c8 @yahonda yahonda committed Oct 19, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/test/cases/migration_test.rb
@@ -471,7 +471,7 @@ def test_native_decimal_insert_manual_vs_automatic
# Do a manual insertion
if current_adapter?(:OracleAdapter)
- Person.connection.execute "insert into people (id, wealth, created_at, updated_at) values (people_seq.nextval, 12345678901234567890.0123456789, 0, 0)"
+ Person.connection.execute "insert into people (id, wealth, created_at, updated_at) values (people_seq.nextval, 12345678901234567890.0123456789, sysdate, sysdate)"
elsif current_adapter?(:OpenBaseAdapter) || (current_adapter?(:MysqlAdapter) && Mysql.client_version < 50003) #before mysql 5.0.3 decimals stored as strings
Person.connection.execute "insert into people (wealth, created_at, updated_at) values ('12345678901234567890.0123456789', 0, 0)"
elsif current_adapter?(:PostgreSQLAdapter)

0 comments on commit 5bc23e4

Please sign in to comment.