Skip to content

Commit

Permalink
Release 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Gama committed Oct 26, 2016
1 parent ac71f0d commit db4af5c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# Changelog

## [2.0.1](https://github.com/seegno/bookshelf-mask/tree/2.0.1) (2016-10-26)
[Full Changelog](https://github.com/seegno/bookshelf-mask/compare/2.0.0...2.0.1)

**Merged pull requests:**

- Update mask prototype property to class property [\#8](https://github.com/seegno/bookshelf-mask/pull/8) ([ricardogama](https://github.com/ricardogama))

## [2.0.0](https://github.com/seegno/bookshelf-mask/tree/2.0.0) (2016-10-26)
[Full Changelog](https://github.com/seegno/bookshelf-mask/compare/1.0.0...2.0.0)

**Merged pull requests:**

- Add release script [\#7](https://github.com/seegno/bookshelf-mask/pull/7) ([ricardogama](https://github.com/ricardogama))
- Add node version badge to README.md [\#6](https://github.com/seegno/bookshelf-mask/pull/6) ([ricardogama](https://github.com/ricardogama))
- Add documentation for ES6 class syntax usage [\#5](https://github.com/seegno/bookshelf-mask/pull/5) ([ricardogama](https://github.com/ricardogama))
- Add .npmignore [\#4](https://github.com/seegno/bookshelf-mask/pull/4) ([ricardogama](https://github.com/ricardogama))
Expand Down
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
exports.default = Bookshelf => {
Bookshelf.Model = Bookshelf.Model.extend({
mask: function mask(scope, options) {
return (0, _jsonMask2.default)(this.toJSON(options), this.masks && this.masks[scope] || scope);
return (0, _jsonMask2.default)(this.toJSON(options), this.constructor.masks && this.constructor.masks[scope] || scope);
}
});

Bookshelf.Collection = Bookshelf.Collection.extend({
mask: function mask(scope, options) {
scope = this.model.prototype.masks && this.model.prototype.masks[scope] || scope;
scope = this.model.masks && this.model.masks[scope] || scope;

return this.toJSON(options).map(model => (0, _jsonMask2.default)(model, scope));
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bookshelf-mask",
"version": "2.0.0",
"version": "2.0.1",
"description": "Mask Bookshelf.js models with json-mask",
"license": "MIT",
"author": {
Expand Down

0 comments on commit db4af5c

Please sign in to comment.