School
.select('schools.id as id', 'name', 'address.city as city', 'address_state.abbr as state')
.join({address: 'state'}, 'inner')
.order('name')
ERROR
School
.select('schools.id as id', 'name', 'address.city as city', 'address_state.abbr as state')
.join({address: 'state'}, 'inner')
.order(['name', 'city'])
I get the error:
TypeError: attribute.split is not a function
at Array.<anonymous> (/home/samps/sites/personal/dus/office.downundersports.com/node/node_modules/openrecord/lib/stores/sql/order.js:68:31)
sql/order.js
...
...
order: function(columns, desc){
var self = this.chain()
if(columns){
if(typeof desc === 'boolean'){
if(!Array.isArray(columns)) columns = [columns]
}else{
columns = Utils.args(arguments)
desc = false
}
for(var i in columns){
//MOST LIKELY NOT PROPERLY ADDING TO INTERNAL HERE
self.addInternal('order', {column: columns[i], order: desc ? 'DESC' : 'ASC'})
}
}else{
self.clearInternal('order')
}
return self
},
...
...
exports.definition = {
mixinCallback: function(){
this.beforeFind(function(query){
var order = this.getInternal('order')
...
...
for(i in order){
var attribute = order[i].column
var tmp = attribute.split('.') //ERROR IS HERE
...
...
}
If i try to order by multiple columns WORKS
ERROR
I get the error:
sql/order.js