A plugin inside an engine

In Rails 3, is it possible to have a plugin inside an engine?

Adding the lib dir of the plugin to autoload_paths doesn't seem to

I can manage to load it by adding that path to $: and requiring the
init.rb file, but I'm not sure that's the correct approach.


Reading through the source in railties/lib/rails/paths.rb, I found

module MyEngine
  class Engine < Rails::Engine
    config.after_initialize do
File.expand_path('../../vendor/plugins', __FILE__)

Is that correct? If it is, then it begs the question, how do I access
the app configuration without directly referencing it's name

Rails.application, I think

You can access it via `Rails.configuration` :slight_smile:

Or if you want to access via application instance, you can use `Rails.application.config`

Of course, didn't think of that. It appears to work beautifully, so I
guess this is the correct approach.


Spoke too soon without testing enough.

It appears the plugin classes are loaded, but the init code is not.

Oh sorry, I saw some similar questions on this list, so I posted here.