The UseEngine plugin explicitly loads the engines models or controllers. This provides the ability to overwrite or extend the engines code with code of the parent application. Mix in engine defined classes in your (parent) app classes for overwriting with custom behaviour. This plugin fixes the lack of the code mixing feature the rails engines plugin had but was not implemented in the rails core.
See http://rails-engines.org/news/2009/02/02/engines-in-rails-2-3/ for more information.
script/plugin install git://github.com/ninjaconcept/use_engine.git
class FrontendUser < User
use_engine :nc_backend_basics
end
class FrontendUser < User
use_engine :nc_backend_basics, :version => '0.4.0', :path => 'models'
end
:version - load a specific version, not the latest (default)
:path - add load path for your engine
This is an initial release that was only tested on Rails 2.3.5!
- change engine load paths to search in vendor/gems then in vendor/plugins and finally in the system's gems
- add some unit tests
Feel free to fork and improve! Feedback is welcome at any time!
- Marco Sehrer (Author)
- Stefan Botzenhart
Copyright © 2010 ninjaconcept, released under the MIT license