Sorry Frederick. This issue is partly resolved but not quite. The problem I think is that I am patching ActiveRecord during initialization. I have stopped my validation code from being unloaded, however when activerecord is reloaded, or particularly my models then they are no longer patched. Does that sound reasonable?
Is there some way I can patch ActiveRecord so it will be patched again when the class is reloaded? Of course I may be totally off-base here and the problem is down to the way ActionWebService is reloading classes, as the model classes are being used within ActionWebService and it is this that is throwing the exception. Steve On Mar 30, 7:12 pm, sweet61 <[email protected]> wrote: > Thanks Frederick, > > That worked perfectly. I modified environment.rb as follows :- > > config.load_paths += %W( #{RAILS_ROOT}/lib/soap_clients/company # > {RAILS_ROOT}/lib/mt_lib) > > # Make sure load_once_paths is a subset of load_paths > config.load_once_paths += %W( #{RAILS_ROOT}/lib/mt_lib) > > On Mar 30, 6:24 pm, Frederick Cheung <[email protected]> > wrote: > > > On Mar 30, 6:20 pm, sweet61 <[email protected]> wrote:> The error > > thrown is > > > > ArgumentError (A copy of MtLib::DBValidations has been removed > > > from > > > the module tree but is still active!): > > > > My question is what is the process that is followed when cache_class > > > is set to false. Does Rails re-run any of the initialization methods? > > > If not then where is the best place for me to put my patch to ensure > > > that it is in all models and survives a classes reload? > > > It doesn't rerun any initialization. If you add your file to > > ActiveSupport::Dependencies.load_once_paths then it won't get > > unloaded. > > > Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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-talk?hl=en -~----------~----~----~----~------~----~------~--~---

