Hi all, I''m new to this list, Ruby, and Rails, Active Record, etc. I am trying to use the Active Record component of Rails, but I''m not getting the big picture. Could someone help fill in the hazy spots? 1. I take it that I am to create a table in the db (I use Postgres) first, then tell AR something about the table I created. It looks like I *have* to use ''id'' as the primary key, even though I might have a perfectly usable primary key embedded in the data. If so, what is the primary_key method for? 2. It seems that I also have to tell AR something about how all my tables relate to one another, even though I''ve done that implicitly in the db already. Is that correct? Does it violate the DRY principle. Can we call it the WET principle? (Wepeat everything twice!) 3. Are there certain fields that I ought to include in every table I create to take advantage of AR magic? I''m thinking of things like a ''created_on'' field to hold a time stamp of when the object was born. Do I have to put these fields in my tables or will AR do that somewhere for me magically? 4. I have a table that has two attributes that I have made unique in the db. When I try to .save AR objects, though, it tells me that I am violating the uniquness constraint after about 12 .saves, even though a perusal of the data indicates that I was not violating the constraint. Is this perhaps because I have to tell AR that the attributes are unique? 5. When converting data from another db, I access the records from the old using DBI, but when I assign date fields to a Date attribute in AR, it won''t convert it to a valid Date object for saving. I am told on comp.lang.ruby that AR does not recognize DBI::Date objects as Date objects, so you have to convert by hand.: ar_object.date_field = Date.new(dbi_do.year, dbi_do.month, dbi_do.day) Is there a cleaner way to do this? Thanks. AR looks really cool, and I want my stuff to be rails-ready if I ever decide to put it on rails, but I''m having conceptual hurdles to get over here at the beginning. -- Daniel Doherty Law Offices of Daniel E. Doherty 8500 College Blvd, Suite 113 Overland Park, KS 66210 913.488.3342 (Voice) 816.448.3790 (FAX) ded-law-4ZlZph8cZsjk1uMJSBkQmQ@public.gmane.org Treason never prospers, What''s the reason? Why, if treason ever prospers, None dare call it treason. -- Sir John Harrington (1561-1612)