Sorry Jeff, not about to start polluting my main application code with that of Datebocks.
Whenever I do an upgrade, change a file, that would mean I have to purge the files from wherever I copied them to. In the case where people have overriden Datebocks for whatever reason.. this causes even more problems. You like many others, don't see the value in engines. Which is totally fine. Doesn't change the fact that I serious value in using them :) The benefits outweight sitations like this. And all it really requires is reporting your findings on the Engines mailing list and James will likely be able to assist in patching Engines so testing works properly. Nathaniel. On 6/19/07, Geoff Davis <[EMAIL PROTECTED]> wrote: > Following up on http://lists.toolbocks.com/pipermail/toolbocks-user/ > 2007-May/000027.html > (datetime_toolbocks fails in functional tests) > > Here's the problem: > > Engines causes plugins to be loaded in 2 phases. First plugins that > don't depend on engines are loaded. Then Rails does some > initialization. Then Engines patches Rails. Then the remaining > plugins get loaded. > > After all that is done, Engines' modifications of dependencies.rb > will cause a subsequent load of application_helper to be patched by > application_helper files in plugins. All well and good in > development and production mode. > > The trouble comes in test mode: the file ~rails/lib/test_help.rb gets > loaded during Rails's initialization, before the engines plugins. > test_help.rb requires application.rb, which in turn loads > application_helper.rb. Because the engines plugins haven't been > loaded yet, application_helper.rb is unpatched, and > datetime_toolbocks's methods are unavailable to functional tests. > > A nasty fix is to copy ~rails/lib/test_help.rb to your project's lib > directory and then add the following two lines right before the call > to require_dependency 'application' > > require 'engines' > Engines.after_initialize > > (Engines.after_initialize loads the extra plugins) > > A real solution is to get datetime_toolbocks off of engines > altogether. It doesn't make much use of the functionality of > engines, and engines introduces all sorts of unnecessary magic. (I > wasted half a day tracking this down) > > Basically you'd need a rake task in the plugin that copied the views > to app/views and a line or two in the plugin's init.rb that patched > application_helper. Pretty simple. It would make everything *much* > cleaner. > > Geoff > > > I set up datetime_toolbocks (current version) against Rails 1.2.3, > > and it works quite well in the app. However, when I run functional > > tests which render that view I get errors: > > > > ActionView::TemplateError: undefined method `toolbocks_date_select' > > for #<#<Class:0x33ac624>:0x3276b24> > > On line #12 of app/views/tasks/_form.rhtml > > > > the relevant line is: > > > > <%= toolbocks_date_select :task, :due_date %></td> > > > > This is in a partial that is called within a form_for block. > > > > Any suggestions on where I should look for the problem? > > > > -faisal > -- Nathaniel Steven Henry Brown Toll Free: 1-877-446-4647 Vancouver: 604-724-6624 _______________________________________________ engine-developers mailing list [email protected] http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org
