RhoSync and relations between models

0 views
Skip to first unread message

Sven Koschnicke

unread,
Nov 23, 2009, 2:28:52 AM11/23/09
to rhomobile
Hello,

is there any mechanism in RhoSync to handle relations between
different sources? Lets say I have two sources, Company and Person. A
person belongs to a company. If one mobile client creates a person and
a new company to which this person belongs to, the backend needs to
know about the company before the person can be created.

Thanks,
Sven Koschnicke

Vidal Graupera

unread,
Nov 23, 2009, 1:31:13 PM11/23/09
to rhomobile
Hi,

Here are two options:

1/ Use the priority attribute in config.rb on the client to cause the
company objects to sync before the people. That way the new company
record will be created before your new person.

2/ Add the new company info into the new person record as extra
attributes. Have your create method for person in rhosync create both
and make the association.

Vidal.
Reply all
Reply to author
Forward
0 new messages