"marcel" made AR/Oracle cry... http://dev.rubyonrails.org/changeset/4608 ------------------------------------------------------------------------ r4608 | marcel | 2006-07-12 20:23:39 -0700 (Wed, 12 Jul 2006) | 1 line Customize default BigDecimal formatting. [dave@pragprog.com] ------------------------------------------------------------------------ A activesupport/lib/active_support/core_ext/bigdecimal A activesupport/lib/active_support/core_ext/bigdecimal/formatting.rb A activesupport/lib/active_support/core_ext/bigdecimal.rb U activesupport/CHANGELOG Updated to revision 4608. 1) Failure: test_schema_dump_includes_decimal_options(SchemaDumperTest) [./test/schema_dumper_test.rb:92]: <"# This file is autogenerated. Instead of editing this file, please use the\n# migrations feature of ActiveRecord to incrementally modify your database, and\n# then regenerate this schema definition.\n\nActiveRecord::Schema.define(:version => 0) do\n\n create_table \"numeric_data\", :force => true do |t|\n t.column \"bank_balance\", :decimal, :precision => 10, :scale => 2\n t.column \"big_bank_balance\", :decimal, :precision => 15, :scale => 2\n t.column \"world_population\", :integer, :limit => 10, :precision => 10, :scale => 0\n t.column \"my_house_population\", :integer, :limit => 2, :precision => 2, :scale => 0\n t.column \"decimal_number_with_default\", :decimal, :precision => 3, :scale => 2, :default => 2.78\n end\n\nend\n"> expected to be =~ </:precision => 3,[[:space:]]+:scale => 2,[[:space:]]+:default => 0.278E1/>. 910 tests, 3228 assertions, 1 failures, 0 errors rake aborted! Command failed with status (1): [/usr/pkg/ruby184/bin/ruby -Ilib:test:test/...] (See full trace by running task with --trace)
Michael Schoen wrote:> "marcel" made AR/Oracle cry... > > http://dev.rubyonrails.org/changeset/4608 > ------------------------------------------------------------------------ > r4608 | marcel | 2006-07-12 20:23:39 -0700 (Wed, 12 Jul 2006) | 1 line > > Customize default BigDecimal formatting. [dave@pragprog.com]This broke the test, as the expected output is now "2.78" and not "0.278E1". Patch to fix: Index: test/schema_dumper_test.rb ==================================================================--- test/schema_dumper_test.rb (revision 4610) +++ test/schema_dumper_test.rb (working copy) @@ -89,7 +89,7 @@ ActiveRecord::SchemaDumper.ignore_tables = [/^[^n]/] ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, stream) output = stream.string - assert_match %r{:precision => 3,[[:space:]]+:scale => 2,[[:space:]]+:default => 0.278E1}, output + assert_match %r{:precision => 3,[[:space:]]+:scale => 2,[[:space:]]+:default => 2.78}, output end end
This AR test is still broken, can somebody apply the patch below? Michael Schoen wrote:> "marcel" made AR/Oracle cry... > > http://dev.rubyonrails.org/changeset/4608 > ------------------------------------------------------------------------ > r4608 | marcel | 2006-07-12 20:23:39 -0700 (Wed, 12 Jul 2006) | 1 line > > Customize default BigDecimal formatting. [dave@pragprog.com]This broke the test, as the expected output is now "2.78" and not "0.278E1". Patch to fix: Index: test/schema_dumper_test.rb ==================================================================--- test/schema_dumper_test.rb (revision 4610) +++ test/schema_dumper_test.rb (working copy) @@ -89,7 +89,7 @@ ActiveRecord::SchemaDumper.ignore_tables = [/^[^n]/] ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, stream) output = stream.string - assert_match %r{:precision => 3,[[:space:]]+:scale => 2,[[:space:]]+:default => 0.278E1}, output + assert_match %r{:precision => 3,[[:space:]]+:scale => 2,[[:space:]]+:default => 2.78}, output end end