Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

Commit

Permalink
select bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Waldmann committed Feb 19, 2014
1 parent fb42201 commit ba8478d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions lib/stores/sql/select.js
Expand Up @@ -16,17 +16,21 @@ exports.definition = {


for(var name in self.attributes){
select.push(self.table_name + '.' + name + ' AS f' + index);
select_map['f' + index++] = name;
if(self.attributes[name].persistent){
select.push(self.table_name + '.' + name + ' AS f' + index);
select_map['f' + index++] = name;
}
}

for(var i in joins){
var relation = joins[i].relation;
var pre = joins[i].name_tree.join('.');

for(var name in relation.model.definition.attributes){
select.push(joins[i].name + '.' + name + ' AS f' + index)
select_map['f' + index++] = pre + '.' + name;
if(relation.model.definition.attributes[name].persistent){
select.push(joins[i].name + '.' + name + ' AS f' + index)
select_map['f' + index++] = pre + '.' + name;
}
}

star = false;
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "openrecord",
"version": "0.3.5",
"version": "0.3.6",
"description": "Active record like ORM for nodejs",
"keywords": ["orm", "record", "sql", "sqlite3", "postgres", "pg", "mysql", "database", "activerecord"],
"author": "Philipp Waldmann <philipp.waldmann@s-team.at>",
Expand Down

0 comments on commit ba8478d

Please sign in to comment.