Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #8919 (new defect)

Opened 10 months ago

[PATCH] Fix load error if plugin directory has a number prefix name

Reported by: maiha Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveSupport Version: 1.2.3
Severity: normal Keywords: autoload plugin constants
Cc:

Description

Autoload fails when we have number prefixed plugin name as follows: vendor/plugins/1st/lib/foo.rb

>> Foo
NoMethodError: You have a nil object when you didn't expect it!

This is because Dependencies#loadable_constants_for_path generates "Plugins::1st::Lib" for constant path information, although it is not a valid format for Ruby constants. This patch offers "D" prefixed plugin name like "Plugins::D1st::Lib" for the digital constants.

FYI: We practically use number prefixed stuff for the loading order. And it worked well in Rails1.1.

Attachments

autoload_fails_with_digital_directory.diff (0.8 kB) - added by maiha on 07/09/07 12:04:57.

Change History

07/09/07 12:04:57 changed by maiha

  • attachment autoload_fails_with_digital_directory.diff added.