When you say, "Unless I'm doing something particularly funky", well......
I have a hand-rolled validator that validates my models based upon the company that is submitting the data and the country they are in. This validator internally uses it's own active-record models to hold the validation data, so it has models called Model, Field, FieldItems etc. I now understand that ActiveRecord is never reloaded, however my validation models are presumably unloaded. This leaves my validation module loaded but it's internally used models are unloaded. Does this explain the behaviour I am seeing and is there a way around it? On Mar 30, 9:37 pm, Frederick Cheung <[email protected]> wrote: > On Mar 30, 9:00 pm, sweet61 <[email protected]> wrote: > > > 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? > > ActiveRecord isn't reloaded ever - only your code is reloaded (which > is problematic in your initial case because). Unless you were doing > something particularly funky I'm not sure off the top of my head what > would be wrong. > > > 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. > > Don't think that has anything to do with that - the reloading stuff is > just part of the general request lifecycle stufff. > > 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 -~----------~----~----~----~------~----~------~--~---

