Hi,

Over the weekend I noticed some strange behavior with ActiveScaffold.
When I should have an ActiveScaffold::ControllerNotFound run-time
exception the exception I saw was a NameError with message
"uninitialized constant ActiveScaffold::ControllerNotFound".

This mystified me at first, but then after stepping through the stack
several times I realized the issue was a Rails plugin loading issue
where if you have too shallow a code tree and one of your file names
clashes with a filename in another plugin, then the other plugin file
may load instead.

So in my case I had another rails plugin written by someone outside my
firm (third party plugin) that has a file named "exceptions.rb" in
their lib directory.  Since this plugin is loaded before most other
plugins, this exceptions.rb is loading twice instead of once and the
AS lib/exceptions.rb file loaded once too.

My hackish workaround was to explicitly require the exceptions.rb file
using absolute paths in the lib/active_scaffold.rb.  However, that is
a rather ugly hack and shouldn't be necessary.

There will no doubt be debate whether or not this is a Rails defect or
an ActiveScaffold defect, but I have always found that directory
namespacing Ruby files in either gems or Rails plugins to be best
practice for non-trivial projects.

I will be refactoring active_scaffold plugin in my GitHub fork,
mbbx6spp/active_scaffold, to follow more of my best practices so that
I don't need to muddle through these annoying issues with Rails.

With forks on GitHub it doesn't matter whether the official
activescaffold/active_scaffold project adopts code structure or not,
this is more of an announcement of why I have forked the project than
what the official team should do.

Best regards,
Susan

PS activescaffold user should ignore my pull request on GitHub for the
hack.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to