Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bookshelf

Package Overview
Dependencies
Maintainers
7
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bookshelf - npm Package Compare versions

Comparing version 0.14.1 to 0.14.2

25

CHANGELOG.md
## Change Log
**0.14.1** <small>_Dec 09, 2018_</small> - [Diff](https://github.com/bookshelf/bookshelf/compare/0.14.0...0.14.1)
**0.14.2** <small>_Dec 17, 2018_</small> - [Diff](https://github.com/bookshelf/bookshelf/compare/0.14.1...0.14.2)
#### Warning
#### Bug fixes
- 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.
- 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)
#### Breaking changes
#### Refactoring
- The `previous()` and `previousAttributes()` 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 [migration guide](https://github.com/bookshelf/bookshelf/wiki/Migrating-from-0.13.3-to-0.14.0#previous-and-previousattributes) in case you are affected by this change. [#1848](https://github.com/bookshelf/bookshelf/pull/1848)
- 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
- Allow passing custom options to the pagination plugin's internal count method. This is useful for better interoperability with other plugins: [#1914](https://github.com/bookshelf/bookshelf/pull/1914)
#### Bug fixes

@@ -18,2 +24,6 @@

#### Documentation
- Add a basic Events guide and fix some issues with the events doclets: [#1917](https://github.com/bookshelf/bookshelf/pull/1917)
**0.14.0** <small>_Dec 09, 2018_</small> - [Diff](https://github.com/bookshelf/bookshelf/compare/0.13.3...0.14.0)

@@ -23,2 +33,3 @@

- The `previous()` and `previousAttributes()` 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 [migration guide](https://github.com/bookshelf/bookshelf/wiki/Migrating-from-0.13.3-to-0.14.0#previous-and-previousattributes) in case you are affected by this change. [#1848](https://github.com/bookshelf/bookshelf/pull/1848)
- Fix incorrect results in collection when models have duplicate ids. Checkout the [migration guide](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) in case you are affected by this. [#1846](https://github.com/bookshelf/bookshelf/pull/1846)

@@ -31,3 +42,2 @@ - Empty `hasOne` relation will now return `null` instead of `{}` when serialized: [#1839](https://github.com/bookshelf/bookshelf/pull/1839). There's a [migration guide](https://github.com/bookshelf/bookshelf/wiki/Migrating-from-0.13.3-to-0.14.0#return-value-for-empty-hasone-relation) in the rare event this causes you problems.

- Allow passing custom options to the pagination plugin's internal count method. This is useful for better interoperability with other plugins: [#1914](https://github.com/bookshelf/bookshelf/pull/1914)
- Make collections iterable using `for ... of` loops: [#1830](https://github.com/bookshelf/bookshelf/pull/1830)

@@ -53,3 +63,2 @@ - Add row-level locking options: [#1810](https://github.com/bookshelf/bookshelf/pull/1810)

- Add a basic Events guide and fix some issues with the events doclets: [#1917](https://github.com/bookshelf/bookshelf/pull/1917)
- Change the JSDoc theme to add a Guides section (this was already released): [#1909](https://github.com/bookshelf/bookshelf/pull/1909)

@@ -56,0 +65,0 @@ - Fix `hasOne`'s doc: [#1890](https://github.com/bookshelf/bookshelf/pull/1890)

@@ -646,5 +646,4 @@ // Base Model

const isNewModel = method === 'insert';
const setUpdatedAt = updatedAtKey && this.hasChanged(updatedAtKey);
if (updatedAtKey && ((isNewModel && !setUpdatedAt) || (this.hasChanged() && !setUpdatedAt))) {
if (updatedAtKey && (isNewModel || this.hasChanged()) && !this.hasChanged(updatedAtKey) ) {
attributes[updatedAtKey] = now;

@@ -651,0 +650,0 @@ }

@@ -235,3 +235,3 @@ 'use strict';

transaction() {
return this.knex.transaction.apply(this, arguments);
return this.knex.transaction.apply(this.knex, arguments);
},

@@ -238,0 +238,0 @@

@@ -169,4 +169,3 @@ 'use strict';

_.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));

@@ -173,0 +172,0 @@ return notNeededQueries.indexOf(statement.type) > -1 || statement.grouping === 'columns';

{
"name": "bookshelf",
"version": "0.14.1",
"version": "0.14.2",
"description": "A lightweight ORM for PostgreSQL, MySQL, and SQLite3",

@@ -5,0 +5,0 @@ "main": "bookshelf.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc