Skip to content

Instantly share code, notes, and snippets.

@qharlie
Created January 12, 2014 01:28
Show Gist options
  • Save qharlie/8379400 to your computer and use it in GitHub Desktop.
Save qharlie/8379400 to your computer and use it in GitHub Desktop.
def getOppositeRelations(modelName: String, program: ProgramAST): List[String] = {
var ret: List[String] = List()
program.models map {
model =>
model.members map {
member =>
member.relationship match {
case RelationAST(None, None) => {
}
case RelationAST(Some(fetchType), Some(nToM)) => {
if (member.memberType == modelName) {
ret = ret :+ model.name
}
}
}
}
}
ret
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment