diff --git a/lib/torque/provider.json.js b/lib/torque/provider.json.js index 5a4e8c8..1099410 100644 --- a/lib/torque/provider.json.js +++ b/lib/torque/provider.json.js @@ -129,7 +129,7 @@ url: function() { var opts = this.options; var port = opts.sql_api_port; - var domain = (opts.sql_api_domain || (this.options.user + '.cartodb.com')) + (port ? ':' + port: ''); + var domain = (opts.user_name + '.' + (opts.sql_api_domain || 'cartodb.com')) + (port ? ':' + port: ''); var protocol = opts.sql_api_protocol || 'http'; return this.options.url || protocol + '://' + domain + '/api/v2/sql'; }, diff --git a/test/provider.json.js b/test/provider.json.js index c1a377f..9b76909 100644 --- a/test/provider.json.js +++ b/test/provider.json.js @@ -4,7 +4,7 @@ module('provider.json') QUnit.testStart(function() { json = new torque.providers.json({ table: 'test', - user: "rambo", + user_name: "rambo", resolution: 1, steps: 10, extra_params: {