Hi Hugo, Using alias_method_chain is normally quite easy, but if you're doing it from within a module you need to be sure that the "alias_method_chain" call is made on the base class when it's included - see the top of engines/lib/engines/rails_extensions/rails_initializer.rb for an example - I'm using base.class_eval to make the calls to alias_method_chain as if they were in the including class itself.
My guess is that it's something like this which is stopping your methods being called - have a play around and if you're still not making any progress, email us the code and we'll take a look. Cheers and thanks for the nice comments :) James On 2/20/07, Hugo Levasseur <[EMAIL PROTECTED]> wrote: > Hi guys, > > I am a member of Steve's team (he posted last month about the 1.2 branch). > > 1st Thanks for the amazing work to James! Engines is an amazing piece of > work. > > To the question then: > > I would need to be able to override a Rails Initializer method > (find_plugins). > I noticed that the rails_initializer.rb file contains the > Engine::RailsExtensions::RailsInitializer which, according > to its leading comment, attempts to override 3 Initializer methods. > > I therefore tried to put my "modified" version of find_plugins using the > conventions found in the > Engine::RailsExtensions::RailsInitializer: > > 1. using 'alias_method chain' : find_plugins, :engine_additions > > 2. writing a method called > 'find_plugins_with_engine_additions' with a slightly > modified body. > > > The problem is that it doesn't seem to be invoked at any time (neither does > the 'load_plugin_with_engine_addition). > > Could you let me know how and where it should be invoked / included to > overwrite this Initializer method > > Thanks! > _______________________________________________ > engine-developers mailing list > [email protected] > http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org > > -- * J * ~ _______________________________________________ engine-developers mailing list [email protected] http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org
