This passed for me on my tests before submitting the patch, but after doing an
''svn update, it failed with the same error.
Looks like a random file ordering issue where the core_ext modules are not
loaded in a known order:
$ cat activesupport/lib/active_support/core_ext.rb
Dir[File.dirname(__FILE__) + "/core_ext/*.rb"].each { |file|
require(file) }
So it worked for me since date.rb was loaded before hash/conversions.rb.
This patch fixed it for me:
Index: activesupport/lib/active_support/core_ext/hash/conversions.rb
==================================================================---
activesupport/lib/active_support/core_ext/hash/conversions.rb
(revision 4413)
+++ activesupport/lib/active_support/core_ext/hash/conversions.rb (working
copy)
@@ -1,3 +1,5 @@
+require ''date''
+
module ActiveSupport #:nodoc:
module CoreExtensions #:nodoc:
module Hash #:nodoc:
Apologies for the breakage.
Regards,
Blair
Michael Schoen wrote:> "bitsweat" made AR/Oracle cry...
>
> http://dev.rubyonrails.org/changeset/4413
> ------------------------------------------------------------------------
> r4413 | bitsweat | 2006-06-02 17:01:08 -0700 (Fri, 02 Jun 2006) | 1 line
>
> to_xml fixes, features, and speedup. Closes #4989.
> ------------------------------------------------------------------------
>
> U activesupport/test/core_ext/array_ext_test.rb
> U activesupport/test/core_ext/hash_ext_test.rb
> U activesupport/lib/active_support/core_ext/hash/conversions.rb
> U activesupport/lib/active_support/core_ext/array/conversions.rb
> U activesupport/CHANGELOG
> U activerecord/test/base_test.rb
> U activerecord/test/fixtures/topics.yml
> U activerecord/lib/active_record/base.rb
> U activerecord/CHANGELOG
> Updated to revision 4413.
>
> /usr/pkg/ruby184/bin/ruby -Ilib:test:test/connections/native_oracle
"/usr/pkg/ruby184/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb"
"test/associations_extensions_test.rb"
"test/deprecated_associations_test.rb" "test/mixin_test.rb"
"test/associations_join_model_test.rb"
"test/ar_schema_test.rb" "test/locking_test.rb"
"test/reflection_test.rb" "test/column_alias_test.rb"
"test/aaa_create_tables_test.rb" "test/associations_test.rb"
"test/unconnected_test.rb" "test/base_test.rb"
"test/associations_cascaded_eager_loading_test.rb"
"test/defaults_test.rb" "test/fixtures_test.rb"
"test/callbacks_test.rb" "test/inheritance_test.rb"
"test/binary_test.rb" "test/schema_dumper_test.rb"
"test/adapter_test.rb"
"test/class_inheritable_attributes_test.rb"
"test/calculations_test.rb"
"test/threaded_connections_test.rb" "test/pk_test.rb"
"test/deprecated_finder_test.rb" "test/associatio
ns_go_eager_test.rb" "test/migration_test.rb"
"test/lifecycle_test.rb" "test/multiple_db_t
e!> st.rb" "test/mixin_nested_set_test.rb"
"test/method_scoping_test.rb" "test/finder_test.rb"
"test/modules_test.rb" "test/transactions_test.rb"
"test/aggregations_test.rb" "test/readonly_test.rb"
"test/association_callbacks_test.rb"
"test/validations_test.rb" "test/empty_date_time_test.rb"
"test/synonym_test_oracle.rb"
> (in /home/mschoen/rails-svn/autopilot/activerecord)
>
./test/../lib/../../activesupport/lib/active_support/core_ext/hash/conversions.rb:8:
uninitialized constant Date (NameError)
> from
./test/../lib/../../activesupport/lib/active_support/core_ext/hash.rb:4
> from ./test/../lib/../../activesupport/lib/active_support/core_ext.rb:1
> from ./test/../lib/../../activesupport/lib/active_support/core_ext.rb:1
> from ./test/../lib/../../activesupport/lib/active_support.rb:31
> from ./test/../lib/active_record.rb:30
> from ./test/abstract_unit.rb:5
> from ./test/associations_extensions_test.rb:1
> from
/usr/pkg/ruby184/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb:5
> from
/usr/pkg/ruby184/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb:5
> rake aborted!
> Command failed with status (1): [/usr/pkg/ruby184/bin/ruby
-Ilib:test:test/...]
>
> (See full trace by running task with --trace)
>
> _______________________________________________
> Rails-core mailing list
> Rails-core@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-core