Created
January 13, 2012 22:53
-
-
Save smoak/1609211 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (f in dbPerson.family) do | |
// try and find the fm in the api | |
foundFm = null | |
for (apiFm in apiPerson.family) do | |
if apiFm == f then | |
foundFm = apiFm | |
break | |
end | |
end | |
if foundFm != null then | |
// merge | |
else | |
// delete | |
end | |
end | |
// now what about inserts? maybe this will do? | |
for (apiFm in apiPerson.family) do | |
foundFm = null | |
for (dbFm in dbPerson.family) do | |
if apiFm == dbFm then | |
foundFm = dbFm | |
break | |
end | |
end | |
if foundFm == null then | |
// insert apiFm | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment