Permalink
Browse files

Changes: Get host, port and database name from database (this) if opt…

…ion doesnt exist
  • Loading branch information...
Enome authored and indexzero committed Feb 22, 2012
1 parent 0ce3856 commit 04933e969d0c4739dfa9d329c03709cab1a89a7f
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/cradle/database/changes.js
@@ -22,6 +22,10 @@ Database.prototype.changes = function (options, callback) {
var feed = new follow.Feed(options),
response = new events.EventEmitter(),
responded = false;
+
+ if( !(options && options.db) ){
+ feed.db = 'http://' + this.connection.host + ':' + this.connection.port + '/' + this.name;
+ }
//
// Remark: Support the legacy `data` events.
@@ -36,4 +40,4 @@ Database.prototype.changes = function (options, callback) {
});
return feed;
-};
+};

0 comments on commit 04933e9

Please sign in to comment.