Doug Jolley wrote: >> Put each class definition in a separate file > > By "separate file" you mean "separate model", right? I guess I could > do that. My concern is that if I do I may be opening and closing the > connection to the database? Maybe I am and maybe I am not. If I am, > maybe I don't need to worry about it; but, I do. That's why I wanted > to let Rails be in charge of handling the connection to the database. > I just want to swap tables. > > Maybe I should ask a couple of more basic questions: What, if any, > are the adverse affects associated with switching models from with an > application? If I swap models from within an application, does that > result in closing and re-opening the database? > > Thanks. > > ... doug
yes, you'll need to have client.rb (containing the Client class) and prospect.rb (containing the Prospect class) files in app/models . No, the amount of models is not related to connections/disconnections from the database. No matter the amount of models, Rails is handling the connection to the database. The way to swap tables is using one model per table. There are no adverse effects of switching models, the database connection is created when you start the app server (webrick, mongrel, phusion) and closed when you end the server. hope it helps, Maximiliano Guzman -- 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 -~----------~----~----~----~------~----~------~--~---

