Am 16.01.2008 um 14:54 schrieb Michael Schuerig:
> On Wednesday 16 January 2008, Sven Fuchs wrote:
>>> For example, are there any changes for plugin authors?   Does this
>>> make *something* they do any easier?
>>
>> This actually would make authoring plugins that "monkeypatch"
>> application controllers easier, yes.
>>
>> Right now one has to jump through hoops to do that (and, above all,
>> know which ones and how).
>
> Would you mind to elaborate? I don't understand what you mean, but I'm
> curious.

You can't alter an app controller class during plugin load stage like  
you can, e.g., alter a model class because Application hasn't loaded  
yet at this stage and autoloading will choke because  
ApplicationController can't be found automatically (due to the file  
naming convention breakage application.rb).

The "right" hoop to jump through might be to just require  
application.rb manually from the plugin. A "wrong" hoop might be to  
postpone controller class patching to e.g. config.to_prepare or  
something (which seems to work on many setups but miserably break on  
some due to class reloading issues).

E.g. in Mephistoland there are lots of examples of situations where  
one wants to add a certain feature through a plugin.

A different path around this issue (rather than renaming  
application.rb) could be to load Application before the plugin loading  
stage by default.

Did that answer your question?

--
sven fuchs                      [EMAIL PROTECTED]
artweb design           http://www.artweb-design.de
grünberger 65           + 49 (0) 30 - 47 98 69 96 (phone)
d-10245 berlin          + 49 (0) 171 - 35 20 38 4 (mobile)




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to