Of course. I need to rethink my architecture, specifically how my
plugins integrate together.

On the most simple level, I have a cms plugin that provides a generic
cms, and other plugins will add additional functionality to it
(catalogue/ecommerce, etc). 

I basically need to tell my Page model in the cms plugin that it has
additional behaviours. At the moment, I simply have a class attribute
array called @behaviours which the other plugins are adding to in their
init.rb's. 

Obviously this is unworkable. Is there an obvious way to modify models
in other plugins in such a way that it get's picked up on reloads? 

My current thinking is that maybe the Page model should check for and
load any enhancements into itself, looking in each plugin..


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of James
Adam
Sent: 27 February 2007 15:46
To: Discussion of the use of existing Engines
Subject: Re: [Engine-users] lib folders and application controllers


On 2/27/07, Tekin Suleyman <[EMAIL PROTECTED]> wrote:
> It appears to me like init.rb is only getting run once during 
> start-up.

This is definitely the case, and is typically why you don't mix modules
from plugins into *anything* that will get reloaded. For example, if
you're adding methods to all controllers, you should include your module
into ActionController::Base, not ApplicationController. The same applies
for the rest of your application...

-- 
* J *
  ~
_______________________________________________
engine-users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.o
rg

_______________________________________________
engine-users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org

Reply via email to