File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## [ 2.1.1] ( https://github.com/seegno/bookshelf-json-columns/tree/2.1.1 ) (2017-07-18)
4+ [ Full Changelog] ( https://github.com/seegno/bookshelf-json-columns/compare/2.1.0...2.1.1 )
5+
6+ ** Merged pull requests:**
7+
8+ - Fix parsing empty strings [ \# 50] ( https://github.com/seegno/bookshelf-json-columns/pull/50 ) ([ zhongzhi107] ( https://github.com/zhongzhi107 ) )
9+
310## [ 2.1.0] ( https://github.com/seegno/bookshelf-json-columns/tree/2.1.0 ) (2017-03-01)
411[ Full Changelog] ( https://github.com/seegno/bookshelf-json-columns/compare/2.0.1...2.1.0 )
512
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ exports.default = Bookshelf => {
110110 return Model . save . call ( this , attributes , options ) . then ( model => {
111111 // Parse JSON columns.
112112 Object . keys ( attributes ) . forEach ( attribute => {
113- if ( this . constructor . jsonColumns . indexOf ( attribute ) !== - 1 ) {
113+ if ( this . constructor . jsonColumns . indexOf ( attribute ) !== - 1 && model . attributes [ attribute ] ) {
114114 model . attributes [ attribute ] = JSON . parse ( model . attributes [ attribute ] ) ;
115115 }
116116 } ) ;
@@ -144,4 +144,4 @@ exports.default = Bookshelf => {
144144 } ) ;
145145} ;
146146
147- module . exports = exports [ 'default' ] ;
147+ module . exports = exports [ 'default' ] ;
Original file line number Diff line number Diff line change 11{
22 "name" : " bookshelf-json-columns" ,
3- "version" : " 2.1.0 " ,
3+ "version" : " 2.1.1 " ,
44 "description" : " Parse JSON columns with Bookshelf.js" ,
55 "license" : " MIT" ,
66 "author" : {
You can’t perform that action at this time.
0 commit comments