resource_controller icon indicating copy to clipboard operation
resource_controller copied to clipboard

application_controller / application dependency check issue

Open rapind opened this issue 16 years ago • 1 comments

in /lib/resource_controller.rb Lines: begin require_dependency 'application_controller' rescue LoadError => e require_dependency 'application' end

The problem with this sort of check is that if you have a load error that has nothing to do with the application_controller v.s. application renamed dependency (say you defined a helper wrong etc.), then the true error is hidden and you get a no such file to load - application error instead.

To reproduce, use the latest rc as a plugin or a gem, create a model, controller, helper, etc. file and declare it wrong. I.e. post_help.rb but declared as "module OopsHelper". This is a pretty contrived example, but the point is, the way rc uses rescue on LoadError means your app hides any meaningful error messages that may occur on load, forcing you to edit rc and comment out those lines to figure out what the actual error was.

rapind avatar Oct 02 '09 15:10 rapind

Same for me... Thanks to @rapind for his explanation.

potomak avatar May 12 '10 14:05 potomak