Skip to content

Commit

Permalink
Closes #51
Browse files Browse the repository at this point in the history
  • Loading branch information
dima committed Dec 14, 2010
1 parent 47a1b71 commit e598582
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions framework/src/org/restfulx/controllers/AuxAIRController.as
Original file line number Diff line number Diff line change
Expand Up @@ -403,18 +403,18 @@ package org.restfulx.controllers {
var tableName:String = Rx.models.state.controllers[target];

var query:String = "SELECT * FROM " + tableName +
" WHERE sync != 'D' AND " + Rx.models.state.names[fqn]["single"] + "_id = '" + item["id"] + "'";
" WHERE sync != 'D' AND " + RxUtils.toSnakeCase(Rx.models.state.names[fqn]["single"]) + "_id = '" + item["id"] + "'";

if (!RxUtils.isEmpty(referAs)) {
var mirrorObject:Object = Rx.models.state.refs[target][referAs];
if (mirrorObject) {
var polymorphic:Boolean = mirrorObject["polymorphic"];

query = "SELECT * FROM " + tableName + " WHERE sync != 'D' AND " +
referAs + "_id = '" + item["id"] + "'";
RxUtils.toSnakeCase(referAs) + "_id = '" + item["id"] + "'";

if (polymorphic) {
query += " AND " + referAs + "_type = '" + fqn.split("::")[1] + "'";
query += " AND " + RxUtils.toSnakeCase(referAs) + "_type = '" + fqn.split("::")[1] + "'";
}
}
}
Expand Down

0 comments on commit e598582

Please sign in to comment.