diff --git a/app/lib/alloy/sync/book_rest.js b/app/lib/alloy/sync/book_rest.js index e20982f..a305814 100644 --- a/app/lib/alloy/sync/book_rest.js +++ b/app/lib/alloy/sync/book_rest.js @@ -8,7 +8,11 @@ module.exports.sync = function(method, model, options) { var payload = model.toJSON(); var error; - + + if(typeof(model.config.adapter.base_url) != 'undefined'){ + BASE_URL = model.config.adapter.base_url; + // this enables other models using the same adapter to work, otherwise the BASE_URL variable persists + } switch(method) { // This case is called by the Model.fetch and Collection.fetch methods to retrieve data. @@ -115,4 +119,4 @@ module.exports.beforeModelCreate = function(config, name) { // Perform some actions after creating the Model class module.exports.afterModelCreate = function(Model, name) { // Nothing to do -}; \ No newline at end of file +};