Hey Jean,

So, what i would do if you really wanted to do this (and i'm not convinced
you should), is just repeat the primary key twice.

e.g. both the Pessoa and Address classes should have "property :id, Serial"
on 'em.  Then you can reference them by key, and do weird things like
Pessoa.has(1, :address, :parent_key=>[:id], :child_key => [:id])

-T

On Tue, Apr 12, 2011 at 10:26 AM, Jean Baldessar
<[email protected]>wrote:

> Hi,
>
> Is it possible to break a table in two Ruby objects? Ex:
>
> Ruby objects:
>
> class Pessoa
>         property :id,            Serial
>         property :name,           String
> end
> class Address
>         property :street,           String
>         property :city,           String
> end
>
> Table:
>
> table Person
> id number
> name varchar
> city varchar
> street varchar
>
> How can i make the "connection" between them And is it possible to make the
> inverse? (table Person and Address to a single Ruby object Person)
>
> Thks in advance,
>
> --
> You received this message because you are subscribed to the Google Groups
> "DataMapper" 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/datamapper?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" 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/datamapper?hl=en.

Reply via email to