Frederick Cheung wrote: > On May 4, 2:57�am, "Mike P." <[email protected]> wrote: > >> I would have probably just used "require ../models/model_a.rb", but I >> found the following at StackOverflow: >> >> "One way to solve this would be to explicitly require the model file >> aircraft.rb. However, you will find this approach quickly leads to >> insanity as it will break the Rails auto-loader in subtle and >> astonishing ways. Rails is much easier if you work with the Rails class >> loader, not against it." > > That can indeed happen (the thing that breaks is usually the code > reloading in development mode). > Does the rest of your app pick up this model automatically. How/where > is this class in /lib being used ? > > Fred
Hi Fred, Thanks for your response. The other parts of the app (i.e. the controllers) do seem to pick up this model. The class in the /lib folder is being used separately. I'm currently running it manually, but I'm looking into running it automatically using a cron job or something similar later on. So, it's not included by another file at the moment, as it's meant to run as a standalone script. (I'm guessing that may have fixed the problem if that file already had access to the model.) Thanks, Mike -- Posted via http://www.ruby-forum.com/. -- 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.

