Model loading test and different load_paths orders


#1

I think that I’ve found the problem that causes the last test in
model_and_lib_test.rb to fail.

http://svn.rails-engines.org/test/engines/rails_2.0/test/unit/model_and_lib_test.rb

The problem is: with two models Something present in two plugins
plugin_a and plugin_b the one in the latter plugin one should, but the
former one actually is loaded.

This only happens when one uses Dependency constant autoloading for
loading the class (as I did in the test). It doesn’t happen when one
explicitely requires the file. This is because the plugin paths are
inserted into $LOAD_PATHS in reverse alphabetical order but appended
to Dependencies.load_paths in alphabetical order.

This behaviour seems to have around since at least Rails 1.2.x

I’ve also posted to the rails-core list:
http://www.ruby-forum.com/topic/134529


sven fuchs removed_email_address@domain.invalid
artweb design http://www.artweb-design.de
grünberger 65 + 49 (0) 30 - 47 98 69 96 (phone)
d-10245 berlin + 49 (0) 171 - 35 20 38 4 (mobile)