Skip to content

Commit

Permalink
Release 0.14.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardograca committed Dec 17, 2018
1 parent 62371cc commit 90cb203
Show file tree
Hide file tree
Showing 25 changed files with 60 additions and 43 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
## Change Log

**0.14.2** <small>_Dec 17, 2018_</small> - [Diff](https://github.com/bookshelf/bookshelf/compare/0.14.1...0.14.2)

#### Bug fixes

- Fix crash when using `groupBy` with table qualifier in pagination plugin: [#1928](https://github.com/bookshelf/bookshelf/pull/1928)
- Fix `undefined` transaction object with Knex 0.15+: [#1926](https://github.com/bookshelf/bookshelf/pull/1926)

#### Refactoring

- Refactor logic behind `.timestamp()`'s decision for when to update the `updated_at` column: [#1892](https://github.com/bookshelf/bookshelf/pull/1892)

**0.14.1** <small>_Dec 09, 2018_</small> - [Diff](https://github.com/bookshelf/bookshelf/compare/0.14.0...0.14.1)

#### Enhancements
Expand Down
10 changes: 5 additions & 5 deletions docs/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@ <h4 id="Model-static-extend" class="item-header">
><span class="class-name"
>Model</span
>.</span><span class="parameters"><span class="name"><a href="api.html#Model-static-extend">extend</a></span><span class="parenthesis">(</span><span class="optional-bracket">[</span><span class="item-name">prototypeProperties</span><span class="optional-bracket">]</span><span class="comma">, </span><span class="optional-bracket">[</span><span class="item-name">classProperties</span><span class="optional-bracket">]</span><span class="parenthesis">)</span></span><span class="type-signature"> &rarr; function</span>
<a href="lib_base_model.js.html#line815" class="source-link">source</a>
<a href="lib_base_model.js.html#line814" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -4776,7 +4776,7 @@ <h4 id="Model-instance-hasChanged" class="item-header">
><span class="class-name"
>model</span
>.</span><span class="parameters"><span class="name"><a href="api.html#Model-instance-hasChanged">hasChanged</a></span><span class="parenthesis">(</span><span class="optional-bracket">[</span><span class="item-name">attribute</span><span class="optional-bracket">]</span><span class="parenthesis">)</span></span><span class="type-signature"> &rarr; Boolean</span>
<a href="lib_base_model.js.html#line687" class="source-link">source</a>
<a href="lib_base_model.js.html#line686" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -6829,7 +6829,7 @@ <h4 id="Model-instance-previous" class="item-header">
><span class="class-name"
>model</span
>.</span><span class="parameters"><span class="name"><a href="api.html#Model-instance-previous">previous</a></span><span class="parenthesis">(</span><span class="item-name">attribute</span><span class="parenthesis">)</span></span><span class="type-signature"> &rarr; mixed</span>
<a href="lib_base_model.js.html#line722" class="source-link">source</a>
<a href="lib_base_model.js.html#line721" class="source-link">source</a>
</h4>


Expand Down Expand Up @@ -6981,7 +6981,7 @@ <h4 id="Model-instance-previousAttributes" class="item-header">
><span class="class-name"
>model</span
>.</span><span class="parameters"><span class="name"><a href="api.html#Model-instance-previousAttributes">previousAttributes</a></span><span class="parenthesis">(</span><span class="parenthesis">)</span></span><span class="type-signature"> &rarr; Object</span>
<a href="lib_base_model.js.html#line762" class="source-link">source</a>
<a href="lib_base_model.js.html#line761" class="source-link">source</a>
</h4>


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

on
December 9, 2018
December 17, 2018

</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.5.5</a>

on
December 9, 2018
December 17, 2018

</div>
</footer>
Expand Down
24 changes: 15 additions & 9 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,26 +235,33 @@ <h3 id="which-opensource-projects-are-using-bookshelf">Which open-source project


<section id="changelog" class="changelog">
<h2>Change Log</h2><p><strong>0.14.1</strong> <small><em>Dec 09, 2018</em></small> - <a href="https://github.com/bookshelf/bookshelf/compare/0.14.0...0.14.1">Diff</a></p>
<h4>Warning</h4><ul>
<li>Incorrectly published the previous version from the wrong branch. That version doesn't contain all
the work that is was supposed to. You shold use this version instead.</li>
<h2>Change Log</h2><p><strong>0.14.2</strong> <small><em>Dec 17, 2018</em></small> - <a href="https://github.com/bookshelf/bookshelf/compare/0.14.1...0.14.2">Diff</a></p>
<h4>Bug fixes</h4><ul>
<li>Fix crash when using <code>groupBy</code> with table qualifier in pagination plugin: <a href="https://github.com/bookshelf/bookshelf/pull/1928">#1928</a></li>
<li>Fix <code>undefined</code> transaction object with Knex 0.15+: <a href="https://github.com/bookshelf/bookshelf/pull/1926">#1926</a></li>
</ul>
<h4>Breaking changes</h4><ul>
<li>The <code>previous()</code> and <code>previousAttributes()</code> methods were changed so that whenever a model is saved or destroyed the previous attributes are no longer reset to the current attributes. Since the old behavior wasn't very useful it's likely this won't cause issues for many people. There's a <a href="https://github.com/bookshelf/bookshelf/wiki/Migrating-from-0.13.3-to-0.14.0#previous-and-previousattributes">migration guide</a> in case you are affected by this change. <a href="https://github.com/bookshelf/bookshelf/pull/1848">#1848</a></li>
<h4>Refactoring</h4><ul>
<li>Refactor logic behind <code>.timestamp()</code>'s decision for when to update the <code>updated_at</code> column: <a href="https://github.com/bookshelf/bookshelf/pull/1892">#1892</a></li>
</ul>
<p><strong>0.14.1</strong> <small><em>Dec 09, 2018</em></small> - <a href="https://github.com/bookshelf/bookshelf/compare/0.14.0...0.14.1">Diff</a></p>
<h4>Enhancements</h4><ul>
<li>Allow passing custom options to the pagination plugin's internal count method. This is useful for better interoperability with other plugins: <a href="https://github.com/bookshelf/bookshelf/pull/1914">#1914</a></li>
</ul>
<h4>Bug fixes</h4><ul>
<li>Fix <code>withRelated</code> fetch option not always grouping properly when using binary primary keys: <a href="https://github.com/bookshelf/bookshelf/pull/1918">#1918</a></li>
</ul>
<h4>Documentation</h4><ul>
<li>Add a basic Events guide and fix some issues with the events doclets: <a href="https://github.com/bookshelf/bookshelf/pull/1917">#1917</a></li>
</ul>
<p><strong>0.14.0</strong> <small><em>Dec 09, 2018</em></small> - <a href="https://github.com/bookshelf/bookshelf/compare/0.13.3...0.14.0">Diff</a></p>
<h4>Breaking changes</h4><ul>
<li>The <code>previous()</code> and <code>previousAttributes()</code> methods were changed so that whenever a model is saved or destroyed the previous attributes are no longer reset to the current attributes. Since the old behavior wasn't very useful it's likely this won't cause issues for many people. There's a <a href="https://github.com/bookshelf/bookshelf/wiki/Migrating-from-0.13.3-to-0.14.0#previous-and-previousattributes">migration guide</a> in case you are affected by this change. <a href="https://github.com/bookshelf/bookshelf/pull/1848">#1848</a></li>
<li>Fix incorrect results in collection when models have duplicate ids. Checkout the <a href="https://github.com/bookshelf/bookshelf/wiki/Migrating-from-0.13.3-to-0.14.0#passing-merge-false-remove-false-to-collectionset-and-default-behavior-with-duplicates">migration guide</a> in case you are affected by this. <a href="https://github.com/bookshelf/bookshelf/pull/1846">#1846</a></li>
<li>Empty <code>hasOne</code> relation will now return <code>null</code> instead of <code>{}</code> when serialized: <a href="https://github.com/bookshelf/bookshelf/pull/1839">#1839</a>. There's a <a href="https://github.com/bookshelf/bookshelf/wiki/Migrating-from-0.13.3-to-0.14.0#return-value-for-empty-hasone-relation">migration guide</a> in the rare event this causes you problems.</li>
<li>Add more helpful error messages on bad or insufficient <code>morphTo</code> data: <a href="https://github.com/bookshelf/bookshelf/pull/1824">#1824</a>. There's a <a href="https://github.com/bookshelf/bookshelf/wiki/Migrating-from-0.13.3-to-0.14.0#new-error-messages-on-bad-or-insufficient-morphto-data">migration guide</a> in case you are affected by this.</li>
<li>Changed the existing functionality so that saving a model that hasn't changed will not update its <code>updated_at</code> attribute: <a href="https://github.com/bookshelf/bookshelf/pull/1798">#1798</a>. Checkout the <a href="https://github.com/bookshelf/bookshelf/wiki/Migrating-from-0.13.3-to-0.14.0#saving-a-model-that-hasnt-changed-wont-update-updated_at">migration guide</a> in case you are affected by this.</li>
</ul>
<h4>Enhancements</h4><ul>
<li>Allow passing custom options to the pagination plugin's internal count method. This is useful for better interoperability with other plugins: <a href="https://github.com/bookshelf/bookshelf/pull/1914">#1914</a></li>
<li>Make collections iterable using <code>for ... of</code> loops: <a href="https://github.com/bookshelf/bookshelf/pull/1830">#1830</a></li>
<li>Add row-level locking options: <a href="https://github.com/bookshelf/bookshelf/pull/1810">#1810</a></li>
</ul>
Expand All @@ -272,7 +279,6 @@ <h4>Test Suite</h4><ul>
<li>Fix incorrect output ordering in tests in some cases: <a href="https://github.com/bookshelf/bookshelf/pull/1825">#1825</a></li>
</ul>
<h4>Documentation</h4><ul>
<li>Add a basic Events guide and fix some issues with the events doclets: <a href="https://github.com/bookshelf/bookshelf/pull/1917">#1917</a></li>
<li>Change the JSDoc theme to add a Guides section (this was already released): <a href="https://github.com/bookshelf/bookshelf/pull/1909">#1909</a></li>
<li>Fix <code>hasOne</code>'s doc: <a href="https://github.com/bookshelf/bookshelf/pull/1890">#1890</a></li>
<li>Fix many-to-many tutorial code: <a href="https://github.com/bookshelf/bookshelf/pull/1888">#1888</a></li>
Expand Down Expand Up @@ -837,7 +843,7 @@ <h4>Other changes</h4><ul>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

</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 @@ -993,7 +993,7 @@ <h1 class="page-title">lib/base/collection.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

</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 @@ -220,7 +220,7 @@ <h1 class="page-title">lib/base/events.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

</div>
</footer>
Expand Down
5 changes: 2 additions & 3 deletions docs/lib_base_model.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -717,9 +717,8 @@ <h1 class="page-title">lib/base/model.js</h1>
const createdAtKey = timestampKeys[0];
const updatedAtKey = timestampKeys[1];
const isNewModel = method === 'insert';
const setUpdatedAt = updatedAtKey &amp;&amp; this.hasChanged(updatedAtKey);

if (updatedAtKey &amp;&amp; ((isNewModel &amp;&amp; !setUpdatedAt) || (this.hasChanged() &amp;&amp; !setUpdatedAt))) {
if (updatedAtKey &amp;&amp; (isNewModel || this.hasChanged()) &amp;&amp; !this.hasChanged(updatedAtKey) ) {
attributes[updatedAtKey] = now;
}

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

on
December 9, 2018
December 17, 2018

</div>
</footer>
Expand Down
4 changes: 2 additions & 2 deletions docs/lib_bookshelf.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ <h1 class="page-title">lib/bookshelf.js</h1>
* Bookshelf~transactionCallback transactionCallback}.
*/
transaction() {
return this.knex.transaction.apply(this, arguments);
return this.knex.transaction.apply(this.knex, arguments);
},

/**
Expand Down Expand Up @@ -458,7 +458,7 @@ <h1 class="page-title">lib/bookshelf.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

</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 @@ -569,7 +569,7 @@ <h1 class="page-title">lib/collection.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

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

on
December 9, 2018
December 17, 2018

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

on
December 9, 2018
December 17, 2018

</div>
</footer>
Expand Down
5 changes: 2 additions & 3 deletions docs/lib_plugins_pagination.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,7 @@ <h1 class="page-title">lib/plugins/pagination.js</h1>
// for a count, and grouping returns the entire result set
// What we want instead is to use `DISTINCT`
_.remove(qb._statements, (statement) => {
if (statement.grouping === 'group')
statement.value.forEach((value) => groupColumns.push(`${tableName}.${value}`));
if (statement.grouping === 'group') statement.value.forEach((value) => groupColumns.push(value));

return notNeededQueries.indexOf(statement.type) > -1 || statement.grouping === 'columns';
});
Expand Down Expand Up @@ -308,7 +307,7 @@ <h1 class="page-title">lib/plugins/pagination.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

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

on
December 9, 2018
December 17, 2018

</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 @@ -843,7 +843,7 @@ <h1 class="page-title">lib/relation.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

</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 @@ -323,7 +323,7 @@ <h1 class="page-title">lib/sync.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-associations.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h3>More details about this topic on the following sections:</h3>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-events.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ <h3>Available destroy related events</h3><p>The available <a href="api.html#Mode
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-many-to-many.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ <h2>Many-to-many</h2>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-models.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ <h3>More details about this topic on the following sections:</h3>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-one-to-many.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ <h2>One-to-many</h2>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-one-to-one.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ <h2>One-to-one</h2>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

</div>
</footer>
Expand Down
8 changes: 5 additions & 3 deletions docs/tutorial-parse-and-format.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@ <h2>Parse and Format</h2>
<pre class="prettyprint source lang-js"><code>Book = bookshelf.Model.extend({
tableName: 'books',
parse: function(response) {
response.tags = JSON.parse(response.tags || '[]');
if(response.tags)
response.tags = JSON.parse(response.tags);
return response;
},
format: function(attributes) {
attributes.tags = JSON.stringify(attributes.tags || []);
if(attributes.tags)
attributes.tags = JSON.stringify(attributes.tags);
return attributes;
}
});</code></pre><p>A very common use case for this is converting camelCase attributes to snake_case column names and vice-versa:</p>
Expand Down Expand Up @@ -115,7 +117,7 @@ <h2>Parse and Format</h2>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-polymorphic.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ <h2>Polymorphic</h2>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ <h1>Guides</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on
December 9, 2018
December 17, 2018

</div>
</footer>
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",
"version": "0.14.1",
"version": "0.14.2",
"description": "A lightweight ORM for PostgreSQL, MySQL, and SQLite3",
"main": "bookshelf.js",
"scripts": {
Expand Down

0 comments on commit 90cb203

Please sign in to comment.