Skip to content

Commit

Permalink
Release 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardograca committed Mar 28, 2020
1 parent 45c23b4 commit 3570afd
Show file tree
Hide file tree
Showing 23 changed files with 82 additions and 46 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
## Change Log

**1.1.1** <small>_Mar 28, 2020_</small> - [Diff](https://github.com/bookshelf/bookshelf/compare/1.1.0...1.1.1)

#### Bug fixes

- Fix attributes that are changed during event hook not being persisted: [#2062](https://github.com/bookshelf/bookshelf/pull/2062)
- Fix incorrect query object being sent to event handlers with `morphTo`: [#2059](https://github.com/bookshelf/bookshelf/pull/2059)
- Fix non-object attributes being passed to `model.parse()` in some cases: [#2056](https://github.com/bookshelf/bookshelf/pull/2056)

#### Documentation

- Fix typo in doclet: [#2057](https://github.com/bookshelf/bookshelf/pull/2057)

**0.15.2** <small>_Mar 28, 2020_</small> - [Diff](https://github.com/bookshelf/bookshelf/compare/0.15.1...0.15.2)

#### Bug fixes

- Fix attributes that are changed during event hook not being persisted: [#2063](https://github.com/bookshelf/bookshelf/pull/2063)

**1.1.0** <small>_Jan 31, 2020_</small> - [Diff](https://github.com/bookshelf/bookshelf/compare/1.0.1...1.1.0)

#### Features
Expand Down
38 changes: 19 additions & 19 deletions docs/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -2768,7 +2768,7 @@ <h5>Example</h5>

<div class="item-description">
<p>List of model attributes to exclude from the output when serializing it. This works as a
blacklist, and all attributes not present in this list will be shown whan calling
blacklist, and all attributes not present in this list will be shown when calling
<a href="api.html#Model-instance-toJSON"><code>toJSON</code></a>.</p>
<p>By default this is <code>null</code> which means that no attributes will be excluded from the output.</p>
<p>You can override this list by passing the <code>{hidden: ['list']}</code> option directly to the
Expand Down Expand Up @@ -3296,7 +3296,7 @@ <h5>Example</h5>

<div class="item-description">
<p>List of model attributes to include in the output when serializing it. This works as a
whitelist, and all attributes not present in this list will be hidden whan calling
whitelist, and all attributes not present in this list will be hidden when calling
<a href="api.html#Model-instance-toJSON"><code>toJSON</code></a>.</p>
<p>By default this is <code>null</code> which means that all attributes will be included in the output.</p>
<p>You can override this list by passing the <code>{visible: ['list']}</code> option directly to the
Expand Down Expand Up @@ -4228,7 +4228,7 @@ <h4 id="Model-instance-destroy" class="item-header">
><span class="class-name"
>model</span
>.</span><span class="parameters"><span class="name"><a href="api.html#Model-instance-destroy">destroy</a></span><span class="parenthesis">(</span><span class="optional-bracket">[</span><span class="item-name">options</span><span class="optional-bracket">]</span><span class="parenthesis">)</span></span><span class="type-signature"> &rarr; Promise<<a href="api.html#Model">Model</a>></span>
<a href="lib_model.js.html#line1239" class="source-link">source</a>
<a href="lib_model.js.html#line1241" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -7676,7 +7676,7 @@ <h4 id="Model-instance-orderBy" class="item-header">
><span class="class-name"
>model</span
>.</span><span class="parameters"><span class="name"><a href="api.html#Model-instance-orderBy">orderBy</a></span><span class="parenthesis">(</span><span class="item-name">sort</span><span class="comma">, </span><span class="item-name">order</span><span class="parenthesis">)</span></span><span class="type-signature"></span>
<a href="lib_model.js.html#line1418" class="source-link">source</a>
<a href="lib_model.js.html#line1420" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -8257,7 +8257,7 @@ <h4 id="Model-instance-query" class="item-header">
><span class="class-name"
>model</span
>.</span><span class="parameters"><span class="name"><a href="api.html#Model-instance-query">query</a></span><span class="parenthesis">(</span><span class="item-name">arguments</span><span class="parenthesis">)</span></span><span class="type-signature"> &rarr; <a href="api.html#Model">Model</a>|QueryBuilder</span>
<a href="lib_model.js.html#line1340" class="source-link">source</a>
<a href="lib_model.js.html#line1342" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -8720,7 +8720,7 @@ <h4 id="Model-instance-resetQuery" class="item-header">
><span class="class-name"
>model</span
>.</span><span class="parameters"><span class="name"><a href="api.html#Model-instance-resetQuery">resetQuery</a></span><span class="parenthesis">(</span><span class="parenthesis">)</span></span><span class="type-signature"> &rarr; <a href="api.html#Model">Model</a></span>
<a href="lib_model.js.html#line1327" class="source-link">source</a>
<a href="lib_model.js.html#line1329" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -10572,7 +10572,7 @@ <h4 id="Model-instance-where" class="item-header">
><span class="class-name"
>model</span
>.</span><span class="parameters"><span class="name"><a href="api.html#Model-instance-where">where</a></span><span class="parenthesis">(</span><span class="item-name">method</span><span class="parenthesis">)</span></span><span class="type-signature"> &rarr; <a href="api.html#Model">Model</a></span>
<a href="lib_model.js.html#line1388" class="source-link">source</a>
<a href="lib_model.js.html#line1390" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -10909,7 +10909,7 @@ <h4 id="Model-event-created" class="item-header">
><span class="class-name"
>model</span
>.</span><span class="event-on">on</span><span class="parenthesis">(</span><a href="api.html#Model-event-created">"created"</a><span class="comma">, </span> <span class="parenthesis">(</span><span class="item-name">model</span><span class="comma">, </span><span class="item-name">options</span><span class="parenthesis">)</span> <span class="fat-arrow">=&gt;</span>
<a href="lib_model.js.html#line1208" class="source-link">source</a>
<a href="lib_model.js.html#line1210" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -11060,7 +11060,7 @@ <h4 id="Model-event-creating" class="item-header">
><span class="class-name"
>model</span
>.</span><span class="event-on">on</span><span class="parenthesis">(</span><a href="api.html#Model-event-creating">"creating"</a><span class="comma">, </span> <span class="parenthesis">(</span><span class="item-name">model</span><span class="comma">, </span><span class="item-name">attrs</span><span class="comma">, </span><span class="item-name">options</span><span class="parenthesis">)</span> <span class="fat-arrow">=&gt;</span>
<a href="lib_model.js.html#line1115" class="source-link">source</a>
<a href="lib_model.js.html#line1117" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -11256,7 +11256,7 @@ <h4 id="Model-event-destroyed" class="item-header">
><span class="class-name"
>model</span
>.</span><span class="event-on">on</span><span class="parenthesis">(</span><a href="api.html#Model-event-destroyed">"destroyed"</a><span class="comma">, </span> <span class="parenthesis">(</span><span class="item-name">model</span><span class="comma">, </span><span class="item-name">options</span><span class="parenthesis">)</span> <span class="fat-arrow">=&gt;</span>
<a href="lib_model.js.html#line1310" class="source-link">source</a>
<a href="lib_model.js.html#line1312" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -11408,7 +11408,7 @@ <h4 id="Model-event-destroying" class="item-header">
><span class="class-name"
>model</span
>.</span><span class="event-on">on</span><span class="parenthesis">(</span><a href="api.html#Model-event-destroying">"destroying"</a><span class="comma">, </span> <span class="parenthesis">(</span><span class="item-name">model</span><span class="comma">, </span><span class="item-name">options</span><span class="parenthesis">)</span> <span class="fat-arrow">=&gt;</span>
<a href="lib_model.js.html#line1284" class="source-link">source</a>
<a href="lib_model.js.html#line1286" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -11943,7 +11943,7 @@ <h4 id="Model-event-saved" class="item-header">
><span class="class-name"
>model</span
>.</span><span class="event-on">on</span><span class="parenthesis">(</span><a href="api.html#Model-event-saved">"saved"</a><span class="comma">, </span> <span class="parenthesis">(</span><span class="item-name">model</span><span class="comma">, </span><span class="item-name">options</span><span class="parenthesis">)</span> <span class="fat-arrow">=&gt;</span>
<a href="lib_model.js.html#line1195" class="source-link">source</a>
<a href="lib_model.js.html#line1197" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -12094,7 +12094,7 @@ <h4 id="Model-event-saving" class="item-header">
><span class="class-name"
>model</span
>.</span><span class="event-on">on</span><span class="parenthesis">(</span><a href="api.html#Model-event-saving">"saving"</a><span class="comma">, </span> <span class="parenthesis">(</span><span class="item-name">model</span><span class="comma">, </span><span class="item-name">attrs</span><span class="comma">, </span><span class="item-name">options</span><span class="parenthesis">)</span> <span class="fat-arrow">=&gt;</span>
<a href="lib_model.js.html#line1095" class="source-link">source</a>
<a href="lib_model.js.html#line1097" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -12292,7 +12292,7 @@ <h4 id="Model-event-updated" class="item-header">
><span class="class-name"
>model</span
>.</span><span class="event-on">on</span><span class="parenthesis">(</span><a href="api.html#Model-event-updated">"updated"</a><span class="comma">, </span> <span class="parenthesis">(</span><span class="item-name">model</span><span class="comma">, </span><span class="item-name">options</span><span class="parenthesis">)</span> <span class="fat-arrow">=&gt;</span>
<a href="lib_model.js.html#line1221" class="source-link">source</a>
<a href="lib_model.js.html#line1223" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -12443,7 +12443,7 @@ <h4 id="Model-event-updating" class="item-header">
><span class="class-name"
>model</span
>.</span><span class="event-on">on</span><span class="parenthesis">(</span><a href="api.html#Model-event-updating">"updating"</a><span class="comma">, </span> <span class="parenthesis">(</span><span class="item-name">model</span><span class="comma">, </span><span class="item-name">attrs</span><span class="comma">, </span><span class="item-name">options</span><span class="parenthesis">)</span> <span class="fat-arrow">=&gt;</span>
<a href="lib_model.js.html#line1132" class="source-link">source</a>
<a href="lib_model.js.html#line1134" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -13009,7 +13009,7 @@ <h4 id="Model-static-NoRowsDeletedError" class="item-header">
><span class="class-name"
>Model</span
>.</span><span class="parameters"><span class="name"><a href="api.html#Model-static-NoRowsDeletedError">NoRowsDeletedError</a></span><span class="parenthesis">(</span><span class="parenthesis">)</span></span><span class="type-signature"></span>
<a href="lib_model.js.html#line1546" class="source-link">source</a>
<a href="lib_model.js.html#line1548" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -13146,7 +13146,7 @@ <h4 id="Model-static-NoRowsUpdatedError" class="item-header">
><span class="class-name"
>Model</span
>.</span><span class="parameters"><span class="name"><a href="api.html#Model-static-NoRowsUpdatedError">NoRowsUpdatedError</a></span><span class="parenthesis">(</span><span class="parenthesis">)</span></span><span class="type-signature"></span>
<a href="lib_model.js.html#line1538" class="source-link">source</a>
<a href="lib_model.js.html#line1540" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -13283,7 +13283,7 @@ <h4 id="Model-static-NotFoundError" class="item-header">
><span class="class-name"
>Model</span
>.</span><span class="parameters"><span class="name"><a href="api.html#Model-static-NotFoundError">NotFoundError</a></span><span class="parenthesis">(</span><span class="parenthesis">)</span></span><span class="type-signature"></span>
<a href="lib_model.js.html#line1529" class="source-link">source</a>
<a href="lib_model.js.html#line1531" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -21305,7 +21305,7 @@ <h5>Returns</h5>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
January 31, 2020
March 28, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/bookshelf.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ <h1 class="page-title">bookshelf.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
January 31, 2020
March 28, 2020

</div>
</footer>
Expand Down
18 changes: 17 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,22 @@ <h3 id="which-opensource-projects-are-using-bookshelf">Which open-source project

<section id="changelog" class="changelog">
<h2>Change Log</h2>
<p><strong>1.1.1</strong> <small><em>Mar 28, 2020</em></small> - <a href="https://github.com/bookshelf/bookshelf/compare/1.1.0...1.1.1">Diff</a></p>
<h4>Bug fixes</h4>
<ul>
<li>Fix attributes that are changed during event hook not being persisted: <a href="https://github.com/bookshelf/bookshelf/pull/2062">#2062</a></li>
<li>Fix incorrect query object being sent to event handlers with <code>morphTo</code>: <a href="https://github.com/bookshelf/bookshelf/pull/2059">#2059</a></li>
<li>Fix non-object attributes being passed to <code>model.parse()</code> in some cases: <a href="https://github.com/bookshelf/bookshelf/pull/2056">#2056</a></li>
</ul>
<h4>Documentation</h4>
<ul>
<li>Fix typo in doclet: <a href="https://github.com/bookshelf/bookshelf/pull/2057">#2057</a></li>
</ul>
<p><strong>0.15.2</strong> <small><em>Mar 28, 2020</em></small> - <a href="https://github.com/bookshelf/bookshelf/compare/0.15.1...0.15.2">Diff</a></p>
<h4>Bug fixes</h4>
<ul>
<li>Fix attributes that are changed during event hook not being persisted: <a href="https://github.com/bookshelf/bookshelf/pull/2063">#2063</a></li>
</ul>
<p><strong>1.1.0</strong> <small><em>Jan 31, 2020</em></small> - <a href="https://github.com/bookshelf/bookshelf/compare/1.0.1...1.1.0">Diff</a></p>
<h4>Features</h4>
<ul>
Expand Down Expand Up @@ -1053,7 +1069,7 @@ <h4>Other changes</h4>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
January 31, 2020
March 28, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_base_collection.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ <h1 class="page-title">lib/base/collection.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
January 31, 2020
March 28, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_base_events.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ <h1 class="page-title">lib/base/events.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
January 31, 2020
March 28, 2020

</div>
</footer>
Expand Down
6 changes: 3 additions & 3 deletions docs/lib_base_model.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ <h1 class="page-title">lib/base/model.js</h1>
* @description
*
* List of model attributes to exclude from the output when serializing it. This works as a
* blacklist, and all attributes not present in this list will be shown whan calling
* blacklist, and all attributes not present in this list will be shown when calling
* {@link Model#toJSON toJSON}.
*
* By default this is `null` which means that no attributes will be excluded from the output.
Expand Down Expand Up @@ -378,7 +378,7 @@ <h1 class="page-title">lib/base/model.js</h1>
* @description
*
* List of model attributes to include in the output when serializing it. This works as a
* whitelist, and all attributes not present in this list will be hidden whan calling
* whitelist, and all attributes not present in this list will be hidden when calling
* {@link Model#toJSON toJSON}.
*
* By default this is `null` which means that all attributes will be included in the output.
Expand Down Expand Up @@ -1085,7 +1085,7 @@ <h1 class="page-title">lib/base/model.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
January 31, 2020
March 28, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_base_relation.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ <h1 class="page-title">lib/base/relation.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
January 31, 2020
March 28, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_bookshelf.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ <h1 class="page-title">lib/bookshelf.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
January 31, 2020
March 28, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_collection.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ <h1 class="page-title">lib/collection.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
January 31, 2020
March 28, 2020

</div>
</footer>
Expand Down
12 changes: 7 additions & 5 deletions docs/lib_model.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,9 @@ <h1 class="page-title">lib/model.js</h1>
Helpers.saveConstraints(this, this.relatedData);
}

const attributesToSave = method === 'update' &amp;&amp; options.patch ? attrs : this.attributes;
const getAttributesToSave = function(method, options, model) {
return method === 'update' &amp;&amp; options.patch ? attrs : model.attributes;
};

// Gives access to the `query` object in the `options`, in case we need it
// in any event handlers.
Expand Down Expand Up @@ -1224,12 +1226,12 @@ <h1 class="page-title">lib/model.js</h1>
return this.triggerThen(
method === 'insert' ? 'saving creating' : 'saving updating',
this,
attributesToSave,
getAttributesToSave(method, options, this),
options
)
.bind(this)
.then(function() {
return sync[options.method](attributesToSave);
return sync[options.method](getAttributesToSave(method, options, this));
})
.then(function(resp) {
// Only valid for databases that support RETURNING
Expand All @@ -1253,7 +1255,7 @@ <h1 class="page-title">lib/model.js</h1>
if (options.require !== false) {
throw new this.constructor.NoRowsUpdatedError('No Rows Updated');
}
} else {
} else if (isObjectResponse) {
Object.assign(this.attributes, this.parse(resp[0]));
}

Expand Down Expand Up @@ -1656,7 +1658,7 @@ <h1 class="page-title">lib/model.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
January 31, 2020
March 28, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_relation.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ <h1 class="page-title">lib/relation.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
January 31, 2020
March 28, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_sync.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ <h1 class="page-title">lib/sync.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
January 31, 2020
March 28, 2020

</div>
</footer>
Expand Down

0 comments on commit 3570afd

Please sign in to comment.