rails/rails — Issue #3804: Railtie/Plugin initialization problem - causes helper :all to malfunction
Author: ndbroadbent
Created: 2011-11-30 10:11:45+00:00
State: open

This seems to be a Railtie bug with Rails 3.1.3. We are trying to support plugins for the application [Fat Free CRM](https://github.com/fatfreecrm/fat_free_crm).

If we simply touch any controller from our plugin (which auto-loads the controller), 'helper :all' then fails for that controller and for all other controllers. By that, I mean that even manually including 'helper :all' in ApplicationController ceases to work properly.

As a test, we have written a sample `my_plugin`. This plugin only requires the following files, in this chain:

`init.rb` -> `require 'my_plugin'` -> ` require 'controllers' `

`my_plugin/lib/controllers.rb` contains a single line:

```ruby
AccountsController
```

That's enough to break `helper :all`. The accounts index page can no longer call a method in the `LeadsHelper`, and the contacts index page also fails.

The commit that seems to have broken this is possibly 98ab4ded376c3d04540bdbdfe6dbbf88c0738701.

We will be moving our application and plugins to Rails Engines soon, but I just wanted to highlight this issue in cases other people have to deal with it too.