Skip to content

Commit 61578fa

Browse files
committed
release 0.7.6
1 parent af3685a commit 61578fa

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

bookshelf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Bookshelf.js 0.7.5
1+
// Bookshelf.js 0.7.6
22
// ---------------
33

44
// (c) 2013 Tim Griesser
@@ -15,7 +15,7 @@ var Bookshelf = function() {
1515
// `Model` and `Collection` constructors for use in the current instance.
1616
Bookshelf.initialize = function(knex) {
1717
var bookshelf = {
18-
VERSION: '0.7.5'
18+
VERSION: '0.7.6'
1919
};
2020

2121
var _ = require('lodash');

browser/bookshelf.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Bookshelf=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
2-
// Bookshelf.js 0.7.5
2+
// Bookshelf.js 0.7.6
33
// ---------------
44

55
// (c) 2013 Tim Griesser
@@ -16,7 +16,7 @@ var Bookshelf = function() {
1616
// `Model` and `Collection` constructors for use in the current instance.
1717
Bookshelf.initialize = function(knex) {
1818
var bookshelf = {
19-
VERSION: '0.7.5'
19+
VERSION: '0.7.6'
2020
};
2121

2222
var _ = _dereq_('lodash');
@@ -523,14 +523,17 @@ _.extend(ModelBase.prototype, _.omit(Backbone.Model.prototype, modelOmitted), Ev
523523
// Returns an object containing a shallow copy of the model attributes,
524524
// along with the `toJSON` value of any relations,
525525
// unless `{shallow: true}` is passed in the `options`.
526+
// Also includes _pivot_ keys for relations unless `{omitPivot: true}`
527+
// is passed in `options`.
526528
toJSON: function(options) {
527529
var attrs = _.extend({}, this.attributes);
528530
if (options && options.shallow) return attrs;
529531
var relations = this.relations;
530532
for (var key in relations) {
531533
var relation = relations[key];
532-
attrs[key] = relation.toJSON ? relation.toJSON() : relation;
534+
attrs[key] = relation.toJSON ? relation.toJSON(options) : relation;
533535
}
536+
if (options && options.omitPivot) return attrs;
534537
if (this.pivot) {
535538
var pivot = this.pivot.attributes;
536539
for (key in pivot) {
@@ -616,6 +619,7 @@ _.extend(ModelBase.prototype, _.omit(Backbone.Model.prototype, modelOmitted), Ev
616619
ModelBase.extend = _dereq_('simple-extend');
617620

618621
module.exports = ModelBase;
622+
619623
},{"./events":4,"./promise":6,"backbone":"5kFNoY","lodash":"K2RcUv","simple-extend":"vZYVcT"}],6:[function(_dereq_,module,exports){
620624
var Promise = _dereq_('bluebird');
621625

index.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<div id="sidebar" class="interface">
2828

2929
<a class="toc_title" href="#">
30-
Bookshelf.js <span class="version">(0.7.5)</span>
30+
Bookshelf.js <span class="version">(0.7.6)</span>
3131
</a>
3232
<ul class="toc_section">
3333
<li>&raquo; <a href="http://github.com/tgriesser/bookshelf">GitHub Repository</a></li>
@@ -195,7 +195,7 @@
195195
and has a comprehensive <a href="https://travis-ci.org/tgriesser/bookshelf">test suite</a>.
196196
</p>
197197

198-
<h2>Latest Release: 0.7.5 - <span class="small"><a href="#changelog">Change Log</a></span></h2>
198+
<h2>Latest Release: 0.7.6 - <span class="small"><a href="#changelog">Change Log</a></span></h2>
199199

200200
<p>
201201
Current Develop &mdash;
@@ -2269,7 +2269,13 @@ <h2 id="faq">F.A.Q.</h2>
22692269
<h2 id="changelog">Change Log</h2>
22702270

22712271
<p>
2272-
<b class="header">0.7.5</b> &mdash; <small><i>June 23, 2014</i></small> &mdash; <a href="https://github.com/tgriesser/bookshelf/compare/0.7.3...0.7.4">Diff</a><br />
2272+
<b class="header">0.7.6</b> &mdash; <small><i>June 29, 2014</i></small> &mdash; <a href="https://github.com/tgriesser/bookshelf/compare/0.7.5...0.7.6">Diff</a><br />
2273+
Add <tt>omitPivot</tt> flag on toJSON options for omitting the <tt>_pivot_</tt> keys in <tt>through</tt> and
2274+
<tt>belongsToMany</tt> relations (#404).
2275+
</p>
2276+
2277+
<p>
2278+
<b class="header">0.7.5</b> &mdash; <small><i>June 23, 2014</i></small> &mdash; <a href="https://github.com/tgriesser/bookshelf/compare/0.7.4...0.7.5">Diff</a><br />
22732279
Fix missing NotFoundError &amp; EmptyError on Model &amp; Collection, respectively (#389, 399).
22742280
</p>
22752281

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bookshelf",
3-
"version": "0.7.5",
3+
"version": "0.7.6",
44
"description": "A lightweight ORM for PostgreSQL, MySQL, and SQLite3",
55
"main": "bookshelf.js",
66
"scripts": {

0 commit comments

Comments
 (0)