Skip to content

Commit

Permalink
1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
iobaixas committed Jan 7, 2015
1 parent 1fea426 commit 472d8c7
Show file tree
Hide file tree
Showing 21 changed files with 285 additions and 38 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,23 @@
<a name="1.1.6"></a>
### 1.1.6 (2015-01-06)


#### Bug Fixes

* adds package.json to release task ([f7875766](http://github.com/angular-platanus/restmod/commit/f78757663c5b64136886f67069f7d694669607a1))
* **factory:** fixes typo in call to canonicalUrlFor. ([5bfa439a](http://github.com/angular-platanus/restmod/commit/5bfa439a1cfe853d322403516ea70e12d51389fa), closes [#227](http://github.com/angular-platanus/restmod/issues/227))
* **fastq:** adds missing 'catch' method to promises ([1fea426a](http://github.com/angular-platanus/restmod/commit/1fea426a1c6607ec3cc323d560f205a7e615be9f), closes [#183](http://github.com/angular-platanus/restmod/issues/183))


#### Features

* **nesteddirty:** adds NestedDirtyModel plugin ([04b6178f](http://github.com/angular-platanus/restmod/commit/04b6178fcd99cd06e08845676313443f290c059e))
* **plugin.nested_dirty:**
* specifies how changing a nested object property to another type affects changed ([2a295779](http://github.com/angular-platanus/restmod/commit/2a295779d77e94300e7aea6a4072c638179fc888))
* adds support for properties ([94bf9375](http://github.com/angular-platanus/restmod/commit/94bf937592136425bad514f618532af248a13936))
* **service:** adds support for custom relation url name transformation. ([5a080925](http://github.com/angular-platanus/restmod/commit/5a08092513b8d1713b7431ea243ecc66564c238d), closes [#159](http://github.com/angular-platanus/restmod/issues/159))


<a name="1.1.5"></a>
### 1.1.5 (2014-12-10)

Expand Down
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "angular-restmod",
"version": "1.1.5",
"version": "1.1.6",
"authors": [
"Ignacio Baixas <ignacio@platan.us>"
],
Expand Down
41 changes: 32 additions & 9 deletions dist/angular-restmod-bundle.js
@@ -1,6 +1,6 @@
/**
* API Bound Models for AngularJS
* @version v1.1.5 - 2014-12-10
* @version v1.1.6 - 2015-01-06
* @link https://github.com/angular-platanus/restmod
* @author Ignacio Baixas <ignacio@platan.us>
* @license MIT License, http://www.opensource.org/licenses/MIT
Expand Down Expand Up @@ -687,8 +687,8 @@ RMModule.factory('RMCommonApi', ['$http', 'RMFastQ', '$log', function($http, $q,
if(_for) {
_for = '$' + _for + 'UrlFor';
if(this.$scope[_for]) return this.$scope[_for](this);
} else if(this.$scope.$cannonicalUrlFor) {
return this.$scope.$cannonicalUrlFor(this);
} else if(this.$scope.$canonicalUrlFor) {
return this.$scope.$canonicalUrlFor(this);
}

return this.$scope.$urlFor(this);
Expand Down Expand Up @@ -2394,7 +2394,7 @@ RMModule.factory('RMBuilderRelations', ['$injector', 'inflector', '$log', 'RMUti
}
}

var scope = this.$buildScope(_model, _url || inflector.parameterize(_attr)), col; // TODO: name to url transformation should be a Model strategy
var scope = this.$buildScope(_model, _url || _model.encodeUrlName(_attr)), col;

// setup collection
col = _model.$collection(_params || null, scope);
Expand Down Expand Up @@ -2459,7 +2459,7 @@ RMModule.factory('RMBuilderRelations', ['$injector', 'inflector', '$log', 'RMUti
}
}

var scope = this.$buildScope(_model, _url || inflector.parameterize(_attr)), inst;
var scope = this.$buildScope(_model, _url || _model.encodeUrlName(_attr)), inst;

// setup record
inst = _model.$new(null, scope);
Expand Down Expand Up @@ -2689,8 +2689,8 @@ RMModule.factory('RMBuilderRelations', ['$injector', 'inflector', '$log', 'RMUti
});

}]);
RMModule.factory('RMModelFactory', ['$injector', 'inflector', 'RMUtils', 'RMScopeApi', 'RMCommonApi', 'RMRecordApi', 'RMListApi', 'RMCollectionApi', 'RMExtendedApi', 'RMSerializer', 'RMBuilder',
function($injector, inflector, Utils, ScopeApi, CommonApi, RecordApi, ListApi, CollectionApi, ExtendedApi, Serializer, Builder) {
RMModule.factory('RMModelFactory', ['$injector', '$log', 'inflector', 'RMUtils', 'RMScopeApi', 'RMCommonApi', 'RMRecordApi', 'RMListApi', 'RMCollectionApi', 'RMExtendedApi', 'RMSerializer', 'RMBuilder',
function($injector, $log, inflector, Utils, ScopeApi, CommonApi, RecordApi, ListApi, CollectionApi, ExtendedApi, Serializer, Builder) {

var NAME_RGX = /(.*?)([^\/]+)\/?$/,
extend = Utils.extendOverriden;
Expand Down Expand Up @@ -3023,7 +3023,25 @@ RMModule.factory('RMModelFactory', ['$injector', 'inflector', 'RMUtils', 'RMScop
* @params {string} _name Record name
* @return {string} Response (raw) name
*/
encodeName: null
encodeName: null,

/**
* @memberof StaticApi#
*
* @description The model name to url encoding strategy
*
* This method is called when translating a name into an url fragment (mainly by relations).
*
* By default it uses the `inflector.parameterize` method, in 1.2 this will change and the default
* behaviour will be to do nothing.
*
* @params {string} _name local name
* @return {string} url fragment
*/
encodeUrlName: function(_name) {
$log.warn('Default paremeterization of urls will be disabled in 1.2, override Model.encodeUrlName with inflector.parameterize in your base model to keep the same behaviour.');
return inflector.parameterize(_name);
}

}, ScopeApi);

Expand Down Expand Up @@ -3302,7 +3320,10 @@ RMModule.factory('RMModelFactory', ['$injector', 'inflector', 'RMUtils', 'RMScop
*/
RMModule.factory('RMFastQ', [function() {

var isFunction = angular.isFunction;
var isFunction = angular.isFunction,
catchError = function(_error) {
return this.then(null, _error);
};

function simpleQ(_val, _withError) {

Expand All @@ -3314,6 +3335,7 @@ RMModule.factory('RMFastQ', [function() {
then: function(_success, _error) {
return simpleQ(_withError ? _error(_val) : _success(_val));
},
'catch': catchError,
'finally': function(_cb) {
var result = _cb();
if(result && isFunction(_val.then)) {
Expand Down Expand Up @@ -3347,6 +3369,7 @@ RMModule.factory('RMFastQ', [function() {
simple.then(_success, _error) :
wrappedQ(_promise.then(_success, _error));
},
'catch': catchError,
'finally': function(_cb) {
return simple ?
simple['finally'](_cb) :
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-restmod-bundle.min.js

Large diffs are not rendered by default.

41 changes: 32 additions & 9 deletions dist/angular-restmod.js
@@ -1,6 +1,6 @@
/**
* API Bound Models for AngularJS
* @version v1.1.5 - 2014-12-10
* @version v1.1.6 - 2015-01-06
* @link https://github.com/angular-platanus/restmod
* @author Ignacio Baixas <ignacio@platan.us>
* @license MIT License, http://www.opensource.org/licenses/MIT
Expand Down Expand Up @@ -449,8 +449,8 @@ RMModule.factory('RMCommonApi', ['$http', 'RMFastQ', '$log', function($http, $q,
if(_for) {
_for = '$' + _for + 'UrlFor';
if(this.$scope[_for]) return this.$scope[_for](this);
} else if(this.$scope.$cannonicalUrlFor) {
return this.$scope.$cannonicalUrlFor(this);
} else if(this.$scope.$canonicalUrlFor) {
return this.$scope.$canonicalUrlFor(this);
}

return this.$scope.$urlFor(this);
Expand Down Expand Up @@ -2156,7 +2156,7 @@ RMModule.factory('RMBuilderRelations', ['$injector', 'inflector', '$log', 'RMUti
}
}

var scope = this.$buildScope(_model, _url || inflector.parameterize(_attr)), col; // TODO: name to url transformation should be a Model strategy
var scope = this.$buildScope(_model, _url || _model.encodeUrlName(_attr)), col;

// setup collection
col = _model.$collection(_params || null, scope);
Expand Down Expand Up @@ -2221,7 +2221,7 @@ RMModule.factory('RMBuilderRelations', ['$injector', 'inflector', '$log', 'RMUti
}
}

var scope = this.$buildScope(_model, _url || inflector.parameterize(_attr)), inst;
var scope = this.$buildScope(_model, _url || _model.encodeUrlName(_attr)), inst;

// setup record
inst = _model.$new(null, scope);
Expand Down Expand Up @@ -2451,8 +2451,8 @@ RMModule.factory('RMBuilderRelations', ['$injector', 'inflector', '$log', 'RMUti
});

}]);
RMModule.factory('RMModelFactory', ['$injector', 'inflector', 'RMUtils', 'RMScopeApi', 'RMCommonApi', 'RMRecordApi', 'RMListApi', 'RMCollectionApi', 'RMExtendedApi', 'RMSerializer', 'RMBuilder',
function($injector, inflector, Utils, ScopeApi, CommonApi, RecordApi, ListApi, CollectionApi, ExtendedApi, Serializer, Builder) {
RMModule.factory('RMModelFactory', ['$injector', '$log', 'inflector', 'RMUtils', 'RMScopeApi', 'RMCommonApi', 'RMRecordApi', 'RMListApi', 'RMCollectionApi', 'RMExtendedApi', 'RMSerializer', 'RMBuilder',
function($injector, $log, inflector, Utils, ScopeApi, CommonApi, RecordApi, ListApi, CollectionApi, ExtendedApi, Serializer, Builder) {

var NAME_RGX = /(.*?)([^\/]+)\/?$/,
extend = Utils.extendOverriden;
Expand Down Expand Up @@ -2785,7 +2785,25 @@ RMModule.factory('RMModelFactory', ['$injector', 'inflector', 'RMUtils', 'RMScop
* @params {string} _name Record name
* @return {string} Response (raw) name
*/
encodeName: null
encodeName: null,

/**
* @memberof StaticApi#
*
* @description The model name to url encoding strategy
*
* This method is called when translating a name into an url fragment (mainly by relations).
*
* By default it uses the `inflector.parameterize` method, in 1.2 this will change and the default
* behaviour will be to do nothing.
*
* @params {string} _name local name
* @return {string} url fragment
*/
encodeUrlName: function(_name) {
$log.warn('Default paremeterization of urls will be disabled in 1.2, override Model.encodeUrlName with inflector.parameterize in your base model to keep the same behaviour.');
return inflector.parameterize(_name);
}

}, ScopeApi);

Expand Down Expand Up @@ -3064,7 +3082,10 @@ RMModule.factory('RMModelFactory', ['$injector', 'inflector', 'RMUtils', 'RMScop
*/
RMModule.factory('RMFastQ', [function() {

var isFunction = angular.isFunction;
var isFunction = angular.isFunction,
catchError = function(_error) {
return this.then(null, _error);
};

function simpleQ(_val, _withError) {

Expand All @@ -3076,6 +3097,7 @@ RMModule.factory('RMFastQ', [function() {
then: function(_success, _error) {
return simpleQ(_withError ? _error(_val) : _success(_val));
},
'catch': catchError,
'finally': function(_cb) {
var result = _cb();
if(result && isFunction(_val.then)) {
Expand Down Expand Up @@ -3109,6 +3131,7 @@ RMModule.factory('RMFastQ', [function() {
simple.then(_success, _error) :
wrappedQ(_promise.then(_success, _error));
},
'catch': catchError,
'finally': function(_cb) {
return simple ?
simple['finally'](_cb) :
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-restmod.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/plugins/debounced.js
@@ -1,6 +1,6 @@
/**
* API Bound Models for AngularJS
* @version v1.1.5 - 2014-12-10
* @version v1.1.6 - 2015-01-06
* @link https://github.com/angular-platanus/restmod
* @author Ignacio Baixas <ignacio@platan.us>
* @license MIT License, http://www.opensource.org/licenses/MIT
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/debounced.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/dirty.js
@@ -1,6 +1,6 @@
/**
* API Bound Models for AngularJS
* @version v1.1.5 - 2014-12-10
* @version v1.1.6 - 2015-01-06
* @link https://github.com/angular-platanus/restmod
* @author Ignacio Baixas <ignacio@platan.us>
* @license MIT License, http://www.opensource.org/licenses/MIT
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/dirty.min.js
@@ -1,6 +1,6 @@
/**
* API Bound Models for AngularJS
* @version v1.1.5 - 2014-12-10
* @version v1.1.6 - 2015-01-06
* @link https://github.com/angular-platanus/restmod
* @author Ignacio Baixas <ignacio@platan.us>
* @license MIT License, http://www.opensource.org/licenses/MIT
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/find-many.js
@@ -1,6 +1,6 @@
/**
* API Bound Models for AngularJS
* @version v1.1.5 - 2014-12-10
* @version v1.1.6 - 2015-01-06
* @link https://github.com/angular-platanus/restmod
* @author Ignacio Baixas <ignacio@platan.us>
* @license MIT License, http://www.opensource.org/licenses/MIT
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/find-many.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 472d8c7

Please sign in to comment.