From: Jamis Buck Date: 2005-07-17T23:05:09+09:00 Subject: Re: Just seen on c.l.py On Jul 17, 2005, at 7:56 AM, James Britt wrote: > David Heinemeier Hansson wrote: > >>> Are you talking about what Rails does, or about how some >>> framework in >>> general might do this? The comment from Joe Van Dyk suggests >>> that now, >>> in Rails, you can evolve your object model and the database will >>> automagically change with it; no more need to "code" in SQL. >>> >> Exactly. >> > > Well, not exactly, or not really what I was thinking of. I meant one > can define a class, with whatever properties and behavior, and Rails > would determine the proper database structure from my actual class > code, not from a separate Ruby command to go create a table. But > being able to avoid running a special configuration too, (i.e, a > SQL editor or admin GUI) in order to write Ruby is a plus in any > event. > > An annoyance I have with Rails is that when I want to see if an > object has some particular property I have to go run an SQL app or > look someplace other than in the class definition. Well, but that's just ActiveRecord, right? Not Rails as a whole. You can use any other ORM you want with Rails, if AR doesn't fit your style of thinking. For me, I really like that AR doesn't clutter my model classees with extraneous definitions. I like looking at a two or three line model class, that only defines the behavior of the class and the foreign key relationships. Others (like yourself, James) obviously prefer the model to be everything, including the explicit definition of the data itself. And that's cool. But yah, ActiveRecord does not do the Og-thang and allow you to define your schema in your model (at least, not so that the database can be created from the model). - Jamis