From: "David A. Black" Date: 2008-08-05T10:10:51+09:00 Subject: Re: unit testing advice Hi -- On Tue, 5 Aug 2008, Avdi Grimm wrote: > On Sun, Aug 3, 2008 at 2:23 PM, David A. Black wrote: >> I'm afraid I don't see the advantage of that, at least in every case, >> over bootstrapping at least part of a database schema and model >> structure first. Certainly the kind of thing you're describing does >> happen, but if I'm creating an Order model and I know that it's going >> to belong to Customer, I'm not averse to saying so up front. Also, >> with a large table, you could get into an awful lot of migrations. > > I've seen a lot of Rails coders completely lose track of the fact that > "Model" means "Domain Model" because of thinking like that. To the > point of getting confused when you start talking about models that > don't derive from ActiveRecord::Base. They've begun to identify > "Model" with "table in the database" rather than "model of a domain > entity". Just another follow-up (see also my earlier post, which addresses your concerns directly): there's a new screencast at railscasts.com today, on exactly that topic: models that are not ActiveRecord models. It's here: http://media.railscasts.com/videos/121_non_active_record_model.mov I'm glad to see it, as this is something that people often don't realize is possible, and when they do it can be quite a revelation. David -- Rails training from David A. Black and Ruby Power and Light: * Advancing With Rails August 18-21 Edison, NJ * Co-taught by D.A. Black and Erik Kastner See http://www.rubypal.com for details and updates!