Skip to content

Commit

Permalink
Release 2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Gama committed Jul 18, 2017
1 parent a6ebb51 commit ff3f7d6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [2.1.1](https://github.com/seegno/bookshelf-json-columns/tree/2.1.1) (2017-07-18)
[Full Changelog](https://github.com/seegno/bookshelf-json-columns/compare/2.1.0...2.1.1)

**Merged pull requests:**

- Fix parsing empty strings [\#50](https://github.com/seegno/bookshelf-json-columns/pull/50) ([zhongzhi107](https://github.com/zhongzhi107))

## [2.1.0](https://github.com/seegno/bookshelf-json-columns/tree/2.1.0) (2017-03-01)
[Full Changelog](https://github.com/seegno/bookshelf-json-columns/compare/2.0.1...2.1.0)

Expand Down
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ exports.default = Bookshelf => {
return Model.save.call(this, attributes, options).then(model => {
// Parse JSON columns.
Object.keys(attributes).forEach(attribute => {
if (this.constructor.jsonColumns.indexOf(attribute) !== -1) {
if (this.constructor.jsonColumns.indexOf(attribute) !== -1 && model.attributes[attribute]) {
model.attributes[attribute] = JSON.parse(model.attributes[attribute]);
}
});
Expand Down Expand Up @@ -144,4 +144,4 @@ exports.default = Bookshelf => {
});
};

module.exports = exports['default'];
module.exports = exports['default'];
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bookshelf-json-columns",
"version": "2.1.0",
"version": "2.1.1",
"description": "Parse JSON columns with Bookshelf.js",
"license": "MIT",
"author": {
Expand Down

0 comments on commit ff3f7d6

Please # to comment.