Its Me
11/22/2004 3:52:00 PM
"George Moschovitis" <gm@navel.gr> wrote
> > Does rails (or active record) have any way to conveniently define and
take
> > advantage of the tree structure of containment?
>
> I dont understant what you want to do, can you explain?
Macro(s) that roughly do the following:
class House
contains_many :attr=>:rooms, :class=>Room, :adder=>:add_room,
:local_key=>:name
end
Automated ways to
- create rooms within context of house
- delete rooms when house is deleted
- persist rooms as part of persisting house (e.g. xml tree)
- enforce: object can only be contained within 1 other object
- provide lookup for room by local_key :name within house
(room's local key = name, global key = house_id + name)
- recursively provide tree-wide lookup
(e.g. to establish non-tree links: e.g. xml id_refs)
- view rooms within view of house
- variations to allow vs. prohibit transfer of rooms
- etc.