There''s a scenario with the projects I''m working on that could use reloadable modules, instead of just reloadable classes. Ticket and patch with test suite changes are at: http://dev.rubyonrails.org/ticket/5329 The reasoning for doing this is I have a library of 25 and growing plugins that define AR models for an legacy Oracle system with some 300 tables. The plan is that developers in our group can use the plugins for their apps and do something like class Post < ActiveRecord::Base include Plugin::PostModel def my_application_specific_method end end There are tons of apps, all separate, so sharing AR models via plugins is nice. So Post is reloaded in development mode, but if you''re writing Plugin::PostModel, then it''s not reloaded and you have to restart the server. The patch let''s you do module Plugin module PostModel include Reloadable end end and have these reloaded also. Regards, Blair
On 8-jun-2006, at 1:31, Blair Zajac wrote:> There''s a scenario with the projects I''m working on that could use > reloadable modules, instead of just reloadable classes. > > Ticket and patch with test suite changes are at: > > http://dev.rubyonrails.org/ticket/5329I am now building an app that assembles functionality from modules and this is instrumental - I''m sick of restarting the server. Would love to see it in Rails. -- Julian ''Julik'' Tarkhanov please send all personal mail to me at julik.nl
Hey, I too have felt the pain of having to restart the server when working on the modules in plugins. However it''s easily avoided by putting a require_dependency ''my_module'' just before the include MyModule call. It''s a small amount of pain that I only have to bear during development so it''s okay with me. I''m not saying this patch is without merit - just that you can work around the issue without having to tinker with the way that rails loads stuff now. Regards, Trevor -- Trevor Squires http://somethinglearned.com On 7-Jun-06, at 8:14 PM, Julian ''Julik'' Tarkhanov wrote:> > On 8-jun-2006, at 1:31, Blair Zajac wrote: > >> There''s a scenario with the projects I''m working on that could use >> reloadable modules, instead of just reloadable classes. >> >> Ticket and patch with test suite changes are at: >> >> http://dev.rubyonrails.org/ticket/5329 > > I am now building an app that assembles functionality from modules > and this is instrumental - I''m sick of restarting the server. Would > love to see it in Rails. > > -- > Julian ''Julik'' Tarkhanov > please send all personal mail to > me at julik.nl > > > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core
On 8-jun-2006, at 6:01, Trevor Squires wrote:> > However it''s easily avoided by putting a require_dependency > ''my_module'' just before the include MyModule call. It''s a small > amount of pain that I only have to bear during development so it''s > okay with me.Thanks for the tip Trevor! -- Julian ''Julik'' Tarkhanov please send all personal mail to me at julik.nl
On Jun 7, 2006, at 9:01 PM, Trevor Squires wrote:> Hey, > > I too have felt the pain of having to restart the server when > working on the modules in plugins. > > However it''s easily avoided by putting a require_dependency > ''my_module'' just before the include MyModule call. It''s a small > amount of pain that I only have to bear during development so it''s > okay with me. >Trevor, Thanks for the tip. I''m now using it in my code. Regards, Blair -- Blair Zajac, Ph.D. <blair@orcaware.com> Subversion training, consulting and support http://www.orcaware.com/svn/