From a9f84fe4fcfcda483d3a66f0bd423786498ac69c Mon Sep 17 00:00:00 2001 From: "DI (FH) Johannes Neugschwentner" Date: Sun, 3 Aug 2014 19:57:21 +0200 Subject: [PATCH 1/4] This should fix the pouchdb bug of replicate is undefined on instance --- angular-pouchdb.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/angular-pouchdb.coffee b/angular-pouchdb.coffee index 6490af4..83f5999 100644 --- a/angular-pouchdb.coffee +++ b/angular-pouchdb.coffee @@ -99,8 +99,8 @@ pouchdb.provider 'pouchdb', -> compact: qify db.compact.bind(db) revsDiff: qify db.revsDiff.bind(db) replicate: - to: db.replicate.to.bind(db) - from: db.replicate.from.bind(db) + to: PouchDB.replicate.bind(db, db) + from: (src, opts) -> PouchDB.replicate.bind(db)(src, db, opts) sync: db.replicate.sync.bind(db) destroy: qify db.destroy.bind(db) ] From 0deac4ed28e923e24cc3e1b2fd81d9e6bf1792cc Mon Sep 17 00:00:00 2001 From: "DI (FH) Johannes Neugschwentner" Date: Sun, 3 Aug 2014 20:04:23 +0200 Subject: [PATCH 2/4] same issue of course, blind bugger --- angular-pouchdb.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-pouchdb.coffee b/angular-pouchdb.coffee index 83f5999..27f812f 100644 --- a/angular-pouchdb.coffee +++ b/angular-pouchdb.coffee @@ -101,7 +101,7 @@ pouchdb.provider 'pouchdb', -> replicate: to: PouchDB.replicate.bind(db, db) from: (src, opts) -> PouchDB.replicate.bind(db)(src, db, opts) - sync: db.replicate.sync.bind(db) + sync: PouchDB.sync.bind(db, db) destroy: qify db.destroy.bind(db) ] From 705b58ddf287c38ea1cd692af5ec15ecb6bd7175 Mon Sep 17 00:00:00 2001 From: "DI (FH) Johannes Neugschwentner" Date: Sun, 3 Aug 2014 20:10:24 +0200 Subject: [PATCH 3/4] why, oh why? --- angular-pouchdb.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-pouchdb.coffee b/angular-pouchdb.coffee index 27f812f..90702a6 100644 --- a/angular-pouchdb.coffee +++ b/angular-pouchdb.coffee @@ -102,7 +102,7 @@ pouchdb.provider 'pouchdb', -> to: PouchDB.replicate.bind(db, db) from: (src, opts) -> PouchDB.replicate.bind(db)(src, db, opts) sync: PouchDB.sync.bind(db, db) - destroy: qify db.destroy.bind(db) + destroy: qify PouchDB.destroy.bind(db, db) ] # pouch-repeat="name in collection" From 69b4807ebbb301238a4cfdd460867fd98e232312 Mon Sep 17 00:00:00 2001 From: Johannes Neugschwentner Date: Sun, 3 Aug 2014 20:15:29 +0200 Subject: [PATCH 4/4] Wow, it's js, what a coffee! --- angular-pouchdb.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/angular-pouchdb.js b/angular-pouchdb.js index 385592b..690133f 100644 --- a/angular-pouchdb.js +++ b/angular-pouchdb.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.4.0 +// Generated by CoffeeScript 1.7.1 /* The MIT License @@ -22,8 +22,7 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - + */ (function() { var concat, exists, indexOf, pouchdb, slice, sortedIndex; @@ -125,11 +124,13 @@ THE SOFTWARE. compact: qify(db.compact.bind(db)), revsDiff: qify(db.revsDiff.bind(db)), replicate: { - to: db.replicate.to.bind(db), - from: db.replicate.from.bind(db), - sync: db.replicate.sync.bind(db) + to: PouchDB.replicate.bind(db, db), + from: function(src, opts) { + return PouchDB.replicate.bind(db)(src, db, opts); + }, + sync: PouchDB.sync.bind(db, db) }, - destroy: qify(db.destroy.bind(db)) + destroy: qify(PouchDB.destroy.bind(db, db)) }; } };