On Jul 26, 5:06 pm, Rick & Nellie Flower <[email protected]> wrote: > > Sounds like you want either validates_with, which enables you to > > package up a set of validations into something reusable or > > validates_associated, which would tell your user that when it > > validates itself it should also validate the associated address > > object. > > Ok.. I'll check into that.. However, I'm still wondering if I can > have nested objects like I mentioned above -- e.g. a User object > containing an Address object and when it's time to write to the > database, both a User object is written but the associated Address > object is also written with some sort of foreign key between the two?
Well contain isn't how I would describe it, but objects that have associations with other objects happens all the time. Checkout the active record associations guide ( http://guides.rubyonrails.org/association_basics.html ) Fred > > Just want to make sure before I proceed down a dead end path with > Rails. Does anyone architect your data that way or just have > duplicated data (e.g. an address for a user vs an address record for > a vendor vs ??) > > Thanks! -- 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.

